0

i have 4 Cells, B2, C2, D2 and E2.
Formula will be in B2.
If C2,D2 & E2 are blank, then B2 is Blank
If C2 is Not Blank, then B2 = C2
If C2 & D2 are not Blank, then B2 = D2
If C2, D2 & E2 are not blank, then B2 = E2
But sometimes i get answer only in D2 or E2,
I want B2 to be = to D2 or E2 even if C2 or D2 is also Blank
I hope what i ask is understandable.

### Discussion

Is what you want either the result in the rightmost column or a blank when there is no data in any of the columns?
gebobs (rep: 30) May 22, '17 at 10:38 am

IF(ISBLANK(C2),"",C2)
IF(ISBLANK(D2),C2,D2)
IF(ISBLANK(E2),D2,E2)

I NEED TO GET THE FINAL ANSWER FROM THE LAST ANSWER I GET.

THANK YOU
Antonio May 23, '17 at 12:24 am
sorry, there was a table when i post it
Antonio May 23, '17 at 12:25 am
don (rep: 1382) Jun 4, '17 at 1:35 am

0

=IF(C2<>"",D2,IF(AND(C2="",D2="",E2=""),"",IF(C2<>"",C2,E2)))

0

This formula will return the value from the last column available. Meaning, it doesn't matter if there is anything in C and D, if E is available that is the value which will be returned.

``=IF(COUNTA(E2), E2,IF(COUNTA(D2),D2,IF(COUNTA(C2),C2,"")))``

Replace COUNTA with COUNT if the values in the tested cells should be numbers. COUNTA checks if there is any content at all, number or text.