# Too Many Arguments in Nested IF Statements starting with IFERROR



## Snake Eyes (Dec 26, 2022)

Greetings,
I'm trying to eliminate the "Too many arguments in this formula" but changes I have tried on my own get me either "Formulas is missing opening or closing parenthesis" or "Too Few Arguments in this formula".
Any clarity would be appreciated.
And while on this topic, is there an excel formula syntax primer that I could review that would help me to resolve seemingly simple issues like this?
Many Thanks.

```
=IFERROR(IF(T18="Monthly",M18*AA18/3),IF(T18="Quarterly",M18*AA18),IF(T18="Semi-Annually",M18*AA18*2),IF(T18="Annually",L18),"")
```


----------



## Fluff (Dec 26, 2022)

How about

```
=IF(T18="Monthly",M18*AA18/3,IF(T18="Quarterly",M18*AA18,IF(T18="Semi-Annually",M18*AA18*2,IF(T18="Annually",L18,""))))
```


----------



## Snake Eyes (Dec 26, 2022)

Thanks Fluff,
But I need the IFERROR statement to eliminate the #VALUE! error when AA18 is blank.


----------



## Fluff (Dec 27, 2022)

In that case just wrap the formula in iferror.


----------



## Snake Eyes (Dec 27, 2022)

When doing so, I get the Too Few Arguments error...

```
=IFERROR(IF(T18="Monthly",M18*AA18/3,IF(T18="Quarterly",M18*AA18,IF(T18="Semi-Annually",M18*AA18*2,IF(T18="Annually",L18,"")))))
```


----------



## Fluff (Dec 27, 2022)

You haven't added the 2nd argument, it should be

```
=IFERROR(IF(T18="Monthly",M18*AA18/3,IF(T18="Quarterly",M18*AA18,IF(T18="Semi-Annually",M18*AA18*2,IF(T18="Annually",L18,"")))),"")
```


----------



## Rick Rothstein (Dec 27, 2022)

Given the values you are checking for, this much shorter formula (which does *not* require IFERROR) will also work...

=SWITCH(LEFT(T18),"M",M18*AA18/3,"Q",M18*AA18,"S",M18*AA18*2,"A",L18,"")


----------



## MEUserII (Dec 27, 2022)

Snake Eyes said:


> Greetings,
> I'm trying to eliminate the "Too many arguments in this formula" but changes I have tried on my own get me either "Formulas is missing opening or closing parenthesis" or "Too Few Arguments in this formula".
> Any clarity would be appreciated.
> And while on this topic, is there an excel formula syntax primer that I could review that would help me to resolve seemingly simple issues like this?
> ...


I have fixed your: "too many...[...]... formula", "formulas...[...]...parenthesis, "too few...[...]...formula"; errors with the following formula listed below. Please try it and let me know if it works.

```
=IFERROR(IF(T18="Monthly", M18*AA18/3, IF(T18="Quarterly", M18*AA18, IF(T18="Semi-Annually", M18*AA18*2, IF(T18="Annually", L18) ) ) ), "" )
```

As for a syntax primer, see the below Microsoft Knowledge Base (KB) article on nested IF() functions, though not a syntax primer in and of itself, it does give insight in to the structure of nested IF() functions.:
Link: IF function – nested formulas and avoiding pitfalls - Microsoft Support

P.S.: Thanks to the contributions from: Fluff, Snake Eyes, and Rick Rothstein; solid solutions.


----------



## Fluff (Dec 27, 2022)

MEUserII said:


> I have fixed your: "too many...[...]... formula", "formulas...[...]...parenthesis, "too few...[...]...formula"


Which is almost exactly what I already posted.  Except you didn't include a false argument for the last IF


----------



## MEUserII (Dec 27, 2022)

Fluff said:


> Which is almost exactly what I already posted.  Except you didn't include a false argument for the last IF


Ah good catch! Yea, I figured it would just result to FALSE without that last FALSE-argument for the last IF()-condition, but didn't consider the whole point of the IFERROR() blank ("") condition was to force a blank ("") entry on ERROR-value, so deducing then, on FALSE result it should also be a blank ("") entry as well. Lol, I've edited the formula below; which if I read your post more thoroughly I would've realized was about the same as yours. 

```
=IFERROR(IF(T18="Monthly", M18*AA18/3, IF(T18="Quarterly", M18*AA18, IF(T18="Semi-Annually", M18*AA18*2, IF(T18="Annually", L18, "") ) ) ), "" )
```


----------



## Snake Eyes (Dec 26, 2022)

Greetings,
I'm trying to eliminate the "Too many arguments in this formula" but changes I have tried on my own get me either "Formulas is missing opening or closing parenthesis" or "Too Few Arguments in this formula".
Any clarity would be appreciated.
And while on this topic, is there an excel formula syntax primer that I could review that would help me to resolve seemingly simple issues like this?
Many Thanks.

```
=IFERROR(IF(T18="Monthly",M18*AA18/3),IF(T18="Quarterly",M18*AA18),IF(T18="Semi-Annually",M18*AA18*2),IF(T18="Annually",L18),"")
```


----------



## Snake Eyes (Dec 29, 2022)

Thanks to each of you for your input here. Truly appreciated.
MEUserII and Fluff, your consensus and last code entries worked for me as did the entry from Rick Rothstein. 
Rick, I'm totally unfamiliar with the SWITCH function so I'm going to have to do some studying on that and I'll also certainly look over the support article to which you linked MEUSerII.
Again, many thanks.


----------



## Fluff (Dec 29, 2022)

Glad we could help & thanks for the feedback.


----------

