Search code examples
excelif-statementexcel-formulanested-if

Question of Excel formula if nested error


I would like to make a formula on excel file which require to meet the following requirements:

  1. If N column is empty, then nothing to do
  2. If N column are not C and O, then show message of "invalid value" (Remark: A,B,D,E.....M,N,P,Q....Z)
  3. If N column is C and T column is empty, then show message of "please write something here"

After run, it prompt up the error message of "You've entered too many arguments for this function". May I know what's wrong with me?

Thanks.

=IF(ISBLANK(N815),"", IF(OR(N815="C",N815="O"),"","Invalid Value!", IF(AND(N815="C",ISBLANK(T815)),"Please write something here!")))

Solution

  • Did you know that you can indent your formula in the formula bar? :)

    =IF(
        Something is True, 
        then do something, 
        otherwise do something else
       )
    

    It is much easier to write when you want multiple IFS

    =IF(
       ISBLANK(N815),
       "",
       IF(
         OR(N815="C",N815="O"),
         IF(
           AND(N815="C", ISBLANK(T815)),
           "Please write something here!",
           ""
           ),
         "invalid value"
         )
        )
    

    enter image description here