joanb
joanb

Reputation: 349

Nested if statements in EXCEL dependent on first condition

I am trying to add some conditions to an excel cell value but I am stuck on how to go about it.

This one works but I need to add an additional condition.

=IF(AND(F6="YES"),EDATE(B6,3),EDATE(H6,3))

if the value in F6 is YES then I also need to check if the value in B6 <> '' because otherwise it is still doing calculations on empty cell values.

Same would be if the value != Yes then I need to check or run the test if H6 <> ''.

Is there a way to achieve this?

Thank you

Upvotes: 0

Views: 41

Answers (1)

rotabor
rotabor

Reputation: 4493

You can nest the IF function as required:

=IF(F6="YES",IF(B6<>"",EDATE(B6,3),"EMPTY"),IF(H6<>"",EDATE(H6,3),"EMPTY"))

Upvotes: 1

Related Questions