+ Reply to Thread
Results 1 to 4 of 4

Error with if()

  1. #1
    Registered User
    Join Date
    03-10-2015
    Location
    test
    MS-Off Ver
    2010
    Posts
    1

    Error with if()

    I am getting an error saying too many arguments entered. Can you identify the culprit?

    =IF(LEFT(G2,1)<5,if(P2<$AD$1,1,0),if(left(G2,1)=5,if(P2>$AD$1,1,if(Q2<$AD$1,1,0),if(left(G2,1)=6,if(P2>$AD$1,1,if(Q2<$AD$1,1,0),if(left(G2,1)=8,if(Q2>$AD$1,1,0)))))))

    For reference, the value of left(g2,1) is a status (one through eight). AD1 is today's date.

    Thank you!

  2. #2
    Forum Expert sourabhg98's Avatar
    Join Date
    10-22-2014
    Location
    New Delhi, India
    MS-Off Ver
    Excel 2007, 2013
    Posts
    1,899

    Re: Error with if()

    Hi
    You are missing two parenthesis maybe
    Try this one
    =IF(LEFT(G2,1)<5,IF(P2<$AD$1,1,0),IF(LEFT(G2,1)=5,IF(P2>$AD$1,1,IF(Q2<$AD$1,1,0)),IF(LEFT(G2,1)=6,IF(P2>$AD$1,1,IF(Q2<$AD$1,1,0)),IF(LEFT(G2,1)=8,IF(Q2>$AD$1,1,0)))))
    Happy to Help

    How to upload excel workbooks at this forum - http://www.excelforum.com/the-water-...his-forum.html

    "I don't get things easily, so please be precise and elaborate"

    If someone's post has helped you, thank by clicking on "Add Reputation" below the post.
    If your query is resolved please mark the thread as "Solved" from the "Thread Tools" above.

    Sourabh

  3. #3
    Forum Guru AlKey's Avatar
    Join Date
    07-20-2009
    Location
    Lakeland, FL USA
    MS-Off Ver
    Microsoft Office 2010/ Office 365
    Posts
    8,903

    Re: Error with if()

    You have to remember that function like LEFT, RIGHT, MID, SUBSTITUTE and REPLACE all return text and therefore need to be converted to a number.

    =LEFT(G2,1)+0
    If you like my answer please click on * Add Reputation
    Don't forget to mark threads as "Solved" if your problem has been resolved

    "Nothing is so firmly believed as what we least know."
    --Michel de Montaigne

  4. #4
    Forum Expert sourabhg98's Avatar
    Join Date
    10-22-2014
    Location
    New Delhi, India
    MS-Off Ver
    Excel 2007, 2013
    Posts
    1,899

    Re: Error with if()

    @Alkey
    Good point..Didn't check that.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Run-tim error -2147467259(80004005): Automation error Unspecidied error
    By mattress58 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-25-2014, 12:12 PM
  2. Excel macro (compile error. syntax error.) error
    By salar_younis in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 01-06-2014, 06:11 AM
  3. Error "run-time Error '1004': General Odbc Error
    By D4WNO77 in forum Access Tables & Databases
    Replies: 2
    Last Post: 07-16-2012, 09:55 AM
  4. Error 75 File/Path access error, sometimes Error 1004
    By smokebreak in forum Excel Programming / VBA / Macros
    Replies: 14
    Last Post: 02-16-2011, 02:35 PM
  5. [SOLVED] Error Handling - On Error GoTo doesn't trap error successfully
    By David in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 02-16-2006, 02:10 PM

Tags for this Thread

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