SOLVED

Error in Excel IF formula

Copper Contributor

What is the error in the below formula

 

=IF((AND(D14="G",E14="II","6",AND(D14="I",E14="II","8",AND(D14="II",E14="III","8",AND(D14="III",E14="I","8"))))))

1 Reply
best response confirmed by thepreserver (Copper Contributor)
Solution

@thepreserver 

The error in your formula is related to incorrect nesting of the AND function within the IF function. Each AND function should be used to combine multiple conditions, but they are not properly nested within the IF function.

Here is the corrected version of your formula:

=IF( AND(D14="G", E14="II"), "6", IF( AND(D14="I", E14="II"), "8", IF( AND(D14="II", E14="III"), "8", IF( AND(D14="III", E14="I"), "8", "" ) ) ) )

In this corrected formula:

  • Each AND function is used to combine two conditions.
  • The IF function is nested properly to handle multiple conditions and return different values based on those conditions.
  • I've added closing parentheses to match the opening parentheses for each AND and IF function.The text and steps were edited with the help of AI.

 

My answers are voluntary and without guarantee!

 

Hope this will help you.

Was the answer useful? Mark as best response and Like it!

This will help all forum participants.

1 best response

Accepted Solutions
best response confirmed by thepreserver (Copper Contributor)
Solution

@thepreserver 

The error in your formula is related to incorrect nesting of the AND function within the IF function. Each AND function should be used to combine multiple conditions, but they are not properly nested within the IF function.

Here is the corrected version of your formula:

=IF( AND(D14="G", E14="II"), "6", IF( AND(D14="I", E14="II"), "8", IF( AND(D14="II", E14="III"), "8", IF( AND(D14="III", E14="I"), "8", "" ) ) ) )

In this corrected formula:

  • Each AND function is used to combine two conditions.
  • The IF function is nested properly to handle multiple conditions and return different values based on those conditions.
  • I've added closing parentheses to match the opening parentheses for each AND and IF function.The text and steps were edited with the help of AI.

 

My answers are voluntary and without guarantee!

 

Hope this will help you.

Was the answer useful? Mark as best response and Like it!

This will help all forum participants.

View solution in original post