Nested if statements in EXCEL dependent on first condition - Stack Overflow

admin2025-04-21  2

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

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

Share Improve this question asked Jan 22 at 21:37 joanbjoanb 3491 gold badge3 silver badges20 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 1

You can nest the IF function as required:

=IF(F6="YES",IF(B6<>"",EDATE(B6,3),"EMPTY"),IF(H6<>"",EDATE(H6,3),"EMPTY"))
转载请注明原文地址:http://anycun.com/QandA/1745227394a90482.html