本文介绍了Excel:数字0-9或逗号分隔值0-9的自定义数据验证的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在以下方面提出了类似的问题: Excel:如何确保单元格包含数字1-6或逗号分隔的数字1-6?

I had asked a similar question in:Excel: how ensure cells contain numbers 1-6 or comma separated numbers 1-6?

JvdV给了我一个很好的答案,并给出了1-6或逗号分隔的公式.

JvdV gave me a great answer and formula for numbers 1-6 or comma separated.

=IFERROR(FILTERXML("<t><s>"&SUBSTITUTE(A1,",","</s><s>")&"</s></t>","//s[preceding::*=.  or .*0!=0 or .*1>6 or .*1<1]"),"")=""

我本来以为修改起来会很容易,但是显然,我不理解语法.什么是语法,仅允许数字0-9或那些值用逗号分隔?

I would have thought it would be easy to modify but obviously, I don't understand the syntax. What is the syntax to allow only the numbers 0-9 or those values separated by commas?

推荐答案

尝试:

=IFERROR(FILTERXML("<t><s>"&SUBSTITUTE(A1,",","</s><s>")&"</s></t>","//s[preceding::*=.  or .*0!=0 or .*1>9 or .*1<0]"),"")=""

这篇关于Excel:数字0-9或逗号分隔值0-9的自定义数据验证的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-02 07:00