Hello friends ,
Follow the challenge here
https://chandoo.org/forum/threads/add-space-between-digits.37136/
One of the problems with the function COUNTIF ,
He can not work with multiple zeros in cells,
Suppose that in cell A1, given 20072505A,Text format.
We want to know if 007 is somewhere in the cell ,In cell C1, we PUT the number 7,
This formula will look for the number 7 ,=COUNTIF(A1,"*"&C1&"*"),
But this formula will be searched 07 =COUNTIF(A1,"*"&TEXT(C1,REPT(0,2))&"*")
And =COUNTIF(A1,"*"&TEXT(C1,REPT(0,3))&"*") will be searched 007 ,
And =COUNTIF(A1,"*"&TEXT(C1,REPT(0,1))&"*") will be searched 7 ,
We see that function REPT controls, and causes COUNTIF function, to work properly.
Of course you can place 0 instead of 7, and then search ,0,00,000 and so.
I hope you understand my English.
David
Follow the challenge here
https://chandoo.org/forum/threads/add-space-between-digits.37136/
One of the problems with the function COUNTIF ,
He can not work with multiple zeros in cells,
Suppose that in cell A1, given 20072505A,Text format.
We want to know if 007 is somewhere in the cell ,In cell C1, we PUT the number 7,
This formula will look for the number 7 ,=COUNTIF(A1,"*"&C1&"*"),
But this formula will be searched 07 =COUNTIF(A1,"*"&TEXT(C1,REPT(0,2))&"*")
And =COUNTIF(A1,"*"&TEXT(C1,REPT(0,3))&"*") will be searched 007 ,
And =COUNTIF(A1,"*"&TEXT(C1,REPT(0,1))&"*") will be searched 7 ,
We see that function REPT controls, and causes COUNTIF function, to work properly.
Of course you can place 0 instead of 7, and then search ,0,00,000 and so.
I hope you understand my English.
David