blank if blank, 1 if greater than a set value

xl22

New member
Joined
Mar 23, 2016
Messages
6
Reaction score
0
Points
0
I think the answer is a nested if function, but I haven't been able to make one work (and I seem to struggle with IF functions)

I have one column of data (A) that has values ranging from about 30 to 100, and includes blank cells
In the next column (B), I want;
B1 to be blank if A1 is blank
B1 to be 1 if A1 is equal or greater than 50
B1 to be 0 if A1 <50

(the 0 and the 1 are more examples than anything, I may also make them text, or a combination)

Thanks in advance!
 
Hello xl22, there might be a cleaner way of doing it, but I tested this if function and it seems to work just fine:

=IF(ISBLANK(A1),"",IF(A1>=50,1,IF(A1<50,0)))

Hope this helps!
 
=IF(ISBLANK(A1),"",IF(A1>=50,1,IF(A1<50,0)))

We can shorten this a bit =IF(COUNTBLANK(A1),"",IF(A1>=50,1,0))


If you are OK with a null value if the cell is empty try =--(A1>=50) ( 0 values can be hidden in Excel options)

COUNTBLANK counts empty cells but also cells containing the null string ( "" ) which is widely used as result of an IFERROR function ( which to me is bad practice...)
 
Last edited:
Back
Top