Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Too many arguments 2

Status
Not open for further replies.

kevtek17

MIS
Aug 28, 2009
2
US
Trying to calculate number of days taken for a training.

If the cells for Day 1 and Day 2 are null, I want to return zero, if both days are filled in, i want to return the number 2, other wise return the number 1.

Here is the formula I used:
=IF(AND(ISBLANK(m2),(ISBLANK(n2))),0,IF(and(not(ISBLANK(m2),and(not(isblank(n2),))2,1)

It appears as though it will work, I just get the Too many arguments error.

Any thoughts?

Thanks,
Kevin

 

Why not simply this:
=IF(M2="",0,1)+IF(N2="",0,1)


Randy
 
The required format:
=if([red]condition[/red],value if true,[blue]value if false[/blue])
Your formula:
=IF([red]AND(ISBLANK(m2)[/red],(ISBLANK(n2))),[blue]0[/blue],IF(and(not(ISBLANK(m2),and(not(isblank(n2),))2,1)
So you do indeed have too many arguments.

This is your formula, corrected:
=IF(AND(ISBLANK(M2),(ISBLANK(N2))),0,IF(AND(NOT(ISBLANK(M2)),NOT(ISBLANK(N2))),2,1))

but it is unnecessarily complex. Another solution would be:
=counta(m2:n2)


Gavin
 
Yes, overcomplex seems to be my initial answer.

Both solutions offered here worked perfectly. Thanks for the quick response.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top