+ Reply to Thread
Results 1 to 11 of 11

IF Function - Too Many Arguments

  1. #1
    Registered User
    Join Date
    07-05-2013
    Location
    Carmel Indiana
    MS-Off Ver
    Excel 2010
    Posts
    5

    Exclamation IF Function - Too Many Arguments

    I'm creating a new spreadsheet to improve staff scheduling and labor forecasting.

    I have no problem with the formula to calculate total number of hours worked for a specific person for a specific shift. My challenge is that I need that cell to return different results based on the total number of hours worked.

    If the person is scheduled for 9 or more hours, I need the total to deduct 1 hour
    If the person is scheduled for 6 or more hours, I need the total to deduct .5 hours
    if the person is scheduled for less than 6 hours, I need total to show without any deductions.
    If the person is not scheduled, I need the total to be zero.

    When trying to create an IF formula for this, I get an error about too many arguments.

    C6 D6 E6
    Start End Hrs
    9:00 AM 3:00 PM 6.00

    What formula can I enter into cell E6 to achieve the above mentioned criteria?

    Thanks!

  2. #2
    Forum Expert Sam Capricci's Avatar
    Join Date
    06-14-2012
    Location
    Palm Harbor, Florida
    MS-Off Ver
    16.84 for Mac MS 365
    Posts
    8,499

    Re: IF Function - Too Many Arguments

    This is what I wrote...
    =if(A6>=9,A6-1,if(and(A6>=6,A6<9),A6-0.5,if(and(A6<6,A6>0),A6,"")))
    This assumes you have the hours worked in column A. Just repoint to where you have the hours, it worked for me.
    Make contributors happy, click on the "* Add Reputation" as a way to say thank you.
    Sam Capricci

  3. #3
    Forum Expert
    Join Date
    12-15-2009
    Location
    Chicago, IL
    MS-Off Ver
    Microsoft Office 365
    Posts
    3,177

    Re: IF Function - Too Many Arguments

    perhaps try UDF if there are too many IF Arguments.

    Please Login or Register  to view this content.
    Attached Files Attached Files

  4. #4
    Registered User
    Join Date
    07-05-2013
    Location
    Carmel Indiana
    MS-Off Ver
    Excel 2010
    Posts
    5

    Re: IF Function - Too Many Arguments

    Quote Originally Posted by Sambo kid View Post
    This is what I wrote...
    =if(A6>=9,A6-1,if(and(A6>=6,A6<9),A6-0.5,if(and(A6<6,A6>0),A6,"")))
    This assumes you have the hours worked in column A. Just repoint to where you have the hours, it worked for me.
    Thanks for the reply. That formula did not work. I may not have explained it correctly.
    Assume that the total appearing in E6 is the sum of (D6-C6)

    C6 D6 E6
    Start End Hrs
    9:00 AM 3:00 PM 6.00

    Any help you could provide would be greatly appreciated!

    Thanks!

  5. #5
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: IF Function - Too Many Arguments

    Maybe this...

    =IF(ISNUMBER(E6),IF(E6=0,0,E6-IF(E6>=9,1,IF(E6>=6,0.5,0))),0)
    Last edited by Tony Valko; 07-05-2013 at 03:30 PM.
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  6. #6
    Registered User
    Join Date
    07-05-2013
    Location
    Carmel Indiana
    MS-Off Ver
    Excel 2010
    Posts
    5

    Re: IF Function - Too Many Arguments

    Please see the attached spreadsheet. Review the Hours column for the total.

    How can I achieve the desired results mentioned previously?
    Attached Files Attached Files

  7. #7
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: IF Function - Too Many Arguments

    Try this entered in E6:

    =IF(COUNT(C6:D6)<2,0,(D6-C6)*24-IF(D6-C6>=TIME(9,0,0),1,IF(D6-C6>=TIME(6,0,0),0.5,0)))

  8. #8
    Forum Contributor
    Join Date
    05-24-2013
    Location
    India
    MS-Off Ver
    Excel 2010
    Posts
    291

    Re: IF Function - Too Many Arguments

    Hi svconners,

    Pls see attached file with accurate formula In E6

    Hope this will work for u

    Thanks,
    A




    Quote Originally Posted by svconners View Post
    I'm creating a new spreadsheet to improve staff scheduling and labor forecasting.

    I have no problem with the formula to calculate total number of hours worked for a specific person for a specific shift. My challenge is that I need that cell to return different results based on the total number of hours worked.

    If the person is scheduled for 9 or more hours, I need the total to deduct 1 hour
    If the person is scheduled for 6 or more hours, I need the total to deduct .5 hours
    if the person is scheduled for less than 6 hours, I need total to show without any deductions.
    If the person is not scheduled, I need the total to be zero.

    When trying to create an IF formula for this, I get an error about too many arguments.

    C6 D6 E6
    Start End Hrs
    9:00 AM 3:00 PM 6.00

    What formula can I enter into cell E6 to achieve the above mentioned criteria?

    Thanks!
    Attached Files Attached Files

  9. #9
    Registered User
    Join Date
    07-05-2013
    Location
    Carmel Indiana
    MS-Off Ver
    Excel 2010
    Posts
    5

    Re: IF Function - Too Many Arguments

    Solved!

    Thanks so much!

  10. #10
    Forum Contributor
    Join Date
    05-24-2013
    Location
    India
    MS-Off Ver
    Excel 2010
    Posts
    291

    Re: IF Function - Too Many Arguments

    Great !!...........

  11. #11
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: IF Function - Too Many Arguments

    You're welcome. Thanks for the feedback!

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1