Forum

Notifications
Clear all

Conditional Formatting OR

4 Posts
3 Users
0 Reactions
126 Views
(@dombrosygmail-com)
Posts: 11
Eminent Member
Topic starter
 

I would like to return TRUE/FALSE if a number includes a "1" (TRUE) or "11" (FALSE).

I'm finding it hard to figure out a suitable formula to achieve this that caters for numbers with more other numerals. e.g. "111", "1196", "19611".

See attached spreadsheet as an example. 

Is there a formula that would cater for this please?

 
Posted : 07/03/2024 8:14 pm
Riny van Eekelen
(@riny)
Posts: 1185
Member Moderator
 

I've entered a formula in the table that produces 0 or 1 in line with the required result FALSE or TRUE. Though, it also returns 0 (i.e. FALSE) if there is no "1" and no "11". For example "234" returns 0.

See attached.

 

EDIT: Forget it, I just found a mistake. The number "10" will also return FALSE but I believe you want it to be TRUE as it has "1" in it. Or not?

 
Posted : 08/03/2024 3:05 am
(@keebellah)
Posts: 373
Reputable Member
 

I was working on the same idea, I added two columns CHECK "1"  and CHECK "11"

Take a look, the desired outcome I have done nothing to that so you can figure out your own logic

 
Posted : 08/03/2024 3:14 am
(@dombrosygmail-com)
Posts: 11
Eminent Member
Topic starter
 

Hey, 

 

thanks for your replies.

 

I realised that if there is a 1, 111 etc, the number of 1's is odd. if 11, that is even. 

I ended up with =ISODD(LEN(B2)-LEN(SUBSTITUTE(B2,"1","")))

 

That works a treat!

 
Posted : 11/03/2024 4:45 pm
Share: