Conditions

  • Thread starter Thread starter Khalil Handal
  • Start date Start date
K

Khalil Handal

Can we make this formula in a different way (maybe different functions) to
make it shorter.
=IF(CP15=1,"",IF(AND(CN15=1,CO15=0),LOOKUP($CO$1,Y!A:A,Y!B:B),IF(AND(CN15=0,CO15=1),LOOKUP($CN$1,Y!A:A,Y!B:B),LOOKUP($CP$1,Y!A:A,Y!B:B))))

This is the case:
three adjacen cell: cn15, co15, cp15.
All possible values are only 0 and 1 according to the following
combinations:

cn15 co15 cp15
1 1 1
0 0 0
1 0 0
0 1 0
 
If those are the only possible combinations:
=IF(COUNT(CN15:CP15)=3, do_1, IF(COUNT(CN15:CP15)=0, do_2, IF(CN15=1, do_4,
do_5)
best wishes
 
Hi again,
I tried the formula but I am not getting anything in the cell!!!.
My formula is:
=IF(COUNT(CN15:CP15)=3,"", IF(COUNT(CN15:CP15)=0,1, IF(CN15=0,2,12)))
I am getting "" (nothing) in all cases?
The formula looks Ok.
 
I think you will need SUM instead of COUNT, as COUNT will count the
zeros. Try this:

=IF(SUM(CN15:CP15)=3,"", IF(SUM(CN15:CP15)=0,1, IF(CN15=0,2,12)))

Hope this helps.

Pete
 
YES,
With SUM it worked fine.
Thanks


I think you will need SUM instead of COUNT, as COUNT will count the
zeros. Try this:

=IF(SUM(CN15:CP15)=3,"", IF(SUM(CN15:CP15)=0,1, IF(CN15=0,2,12)))

Hope this helps.

Pete
 
Back
Top