+ Reply to Thread
Results 1 to 11 of 11

Nested if statement not working

Hybrid View

  1. #1
    Registered User
    Join Date
    07-15-2015
    Location
    new hampshire
    MS-Off Ver
    Office 2010
    Posts
    83

    Nested if statement not working

    In q39 i am trying to write - =if(p39="",0,(j39*2/156),if(o39="eow",(j39*2/156)/2),(j39*2/156)))
    and it says i have too many arguments.
    Why?

    When "eow" (every other week) is chosen, i need to get half of the 2.54 total in that cell.
    Attached Files Attached Files

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

    Re: Nested if statement not working

    you need another parens here =if(p39="",0,(j39*2/156),if(o39="eow",((j39*2/156)/2),(j39*2/156)))
    Make contributors happy, click on the "* Add Reputation" as a way to say thank you.
    Sam Capricci

  3. #3
    Registered User
    Join Date
    07-15-2015
    Location
    new hampshire
    MS-Off Ver
    Office 2010
    Posts
    83

    Re: Nested if statement not working

    Thank you!
    I am getting this...
    #VALUE!
    with this.
    =IF(P39="",0,(J39*2)/156),IF(O39="eow",((J39*2/156)/2),(J39*2/156))....and it will not allow that last (3rd) parens in yours....

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

    Re: Nested if statement not working

    you have another issue, your first argument ends. when you write this if(p39="",0,(j39*2/156),if... you ended your first if statement. Your argument is going, if p39 is blank, (then) return 0 (otherwise) multiply j39 by 2 and divide by 156. The rest of the argument stops. You've effectively stopped the calculation. It doesn't know what to do with the rest.

    edit: i didn't find it until i tried yours.

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

    Re: Nested if statement not working

    how about this? =if(p39="",0,if(and(p39<>"",o39="eow"),((J39*2/156)/2),(j39*2/156)))
    it appears to work in your sheet.

    edit: sorry, had to adjust it.

  6. #6
    Registered User
    Join Date
    07-15-2015
    Location
    new hampshire
    MS-Off Ver
    Office 2010
    Posts
    83

    Re: Nested if statement not working

    ty,
    What is the trick to copy and paste, or is that against the rules?

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

    Re: Nested if statement not working

    there is no rule against copy and pasting that I'm aware of. I do it all the time.

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

    Re: Nested if statement not working

    is there a place to do an "and"?

  9. #9
    Registered User
    Join Date
    07-15-2015
    Location
    new hampshire
    MS-Off Ver
    Office 2010
    Posts
    83

    Re: Nested if statement not working

    Yes, how.
    I need it to divide it by 2 if eow is selected....

  10. #10
    Registered User
    Join Date
    07-15-2015
    Location
    new hampshire
    MS-Off Ver
    Office 2010
    Posts
    83

    Re: Nested if statement not working

    thanks for you help it worked!

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

    Re: Nested if statement not working

    Great! if that solved it for you don't forget to mark the post as solved using the thread tools dropdown at the top of the post.

    And if you're so inclined bumping my reputation is always nice, that is how we advance on this forum.

+ 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] Conditional Formatting not working when applied to nested IF statement
    By mcstaff in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 08-26-2014, 02:33 PM
  2. [SOLVED] Nested IF statement not working
    By Markjoyous in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 06-11-2014, 12:25 PM
  3. [SOLVED] Nested if statement not working
    By crsport3 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 04-08-2014, 07:12 PM
  4. [SOLVED] Nested If statement not working
    By hornet7 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 11-08-2013, 01:31 PM
  5. [SOLVED] Simple nested IF statement not working correctly
    By bassemsaad in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 08-04-2013, 08:53 AM
  6. [SOLVED] Nested IF statement using Lookup is not working
    By DPKologie in forum Excel Formulas & Functions
    Replies: 11
    Last Post: 08-22-2012, 07:36 PM
  7. nested IF statement not working
    By piquet2759 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 08-13-2009, 07:03 PM

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