Gemma
Gemma

Reputation: 1

Excel nested if and statements

I'm trying to create a spreadsheet with nested if and statements but I keep getting a too many arguments error (despite using an example I found online). Can anyone see where I'm going wrong? I've been googling fruitlessly for a while!

= IF(AND(D5>=$M$3, E5<=$M$4),
     F5, 
     IF(AND(D5>=$M$3, D5<=$M$4),
         NETWORKDAYS(D5, $M$4, ($U$5:$U$68), 
             IF(AND(E5>=$M$3, E5<=$M$4),
                 NETWORKDAYS($M$3, E5, ($U$5:$U$68))))

Upvotes: 0

Views: 35

Answers (1)

Ron Rosenfeld
Ron Rosenfeld

Reputation: 60164

Your NETWORKDAYS formulas are incorrect:

You have:

NETWORKDAYS(D5,$M$4,($U$5:$U$68)

should be:

NETWORKDAYS(D5,$M$4,$U$5:$U$68)

although

NETWORKDAYS(D5,$M$4,($U$5:$U$68))

would also work, but the parentheses around the holidays argument are redundant.

Upvotes: 1

Related Questions