+ Reply to Thread
Results 1 to 9 of 9

Nested IF statements are returning FALSE values - cannot find error in code!

  1. #1
    Registered User
    Join Date
    02-19-2013
    Location
    Melbourne, Australia
    MS-Off Ver
    Excel 2010
    Posts
    6

    Question Nested IF statements are returning FALSE values - cannot find error in code!

    Hi guys,

    I'm using nested IF statements to return the department and time various employees are working at a bakery.

    My formula to return the time they're working returns a FALSE rather than the shift time and I'm having a hard time working out why - help would be greatly appreciated!

    Cheers,
    Alex

    Fairbank roster summary page.xlsx

  2. #2
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,929

    Re: Nested IF statements are returning FALSE values - cannot find error in code!

    Hi and welcome to the forum

    your 2nd and 3rd IF's dont have the 3rd argument, so take a look at that.

    However, see if this shorter formula will do what you want? ...
    =INDEX(INDIRECT(H3&"!$E:$E"),MATCH(Summary!B3,INDIRECT(H3&"!$D:$D"),0))
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  3. #3
    Forum Moderator vlady's Avatar
    Join Date
    09-22-2011
    Location
    Philippines - OLSHCO -Guimba-Nueva Ecija
    MS-Off Ver
    2021
    Posts
    4,361

    Re: Nested IF statements are returning FALSE values - cannot find error in code!

    same approach with the above.. just notice the difference between the ranges used so posted this one.
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    I think people forget the word "THANK YOU!!!!" Do you still know it???

    There is a little star ( ADD REPUTATION ) below those person who helped you. Click it to say your "PRIVATE APPRECIATION TO THEIR EFFORT ON THEIR CONTRIBUTIONS "

    Regards,
    Vladimir

  4. #4
    Registered User
    Join Date
    02-19-2013
    Location
    Melbourne, Australia
    MS-Off Ver
    Excel 2010
    Posts
    6

    Re: Nested IF statements are returning FALSE values - cannot find error in code!

    That short formula is golden and does exactly what I need it to. Thank you so much!

  5. #5
    Registered User
    Join Date
    02-19-2013
    Location
    Melbourne, Australia
    MS-Off Ver
    Excel 2010
    Posts
    6

    Re: Nested IF statements are returning FALSE values - cannot find error in code!

    May have celebrated too early? Times are not being returned for 2 out of 5 departments.

    Fairbank roster summary page.xlsx

  6. #6
    Forum Moderator vlady's Avatar
    Join Date
    09-22-2011
    Location
    Philippines - OLSHCO -Guimba-Nueva Ecija
    MS-Off Ver
    2021
    Posts
    4,361

    Re: Nested IF statements are returning FALSE values - cannot find error in code!

    look at post #3

    you have different ranges for the department.
    Load Bay and Stores have the same ranges D:D and C:C respectively
    the remaining department uses E:E and D:D respectively

  7. #7
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,929

    Re: Nested IF statements are returning FALSE values - cannot find error in code!

    Thanks Vlad, there was no daya in the other sheets, so I could not test them. And if that works, maybe this slightly shorter 1 will work too?...

    =INDEX(INDIRECT(H3&IF(OR(H3="Load Bay",H3="Stores"),"!$D:$D","!$E:$E")),MATCH(Summary!B3,INDIRECT(H3&"!$C:$C"),0))
    Last edited by FDibbins; 11-03-2013 at 10:19 PM.

  8. #8
    Registered User
    Join Date
    02-19-2013
    Location
    Melbourne, Australia
    MS-Off Ver
    Excel 2010
    Posts
    6

    Re: Nested IF statements are returning FALSE values - cannot find error in code!

    Added an extra column to Load Bay and Stores so that all departments have the same range.

    =IFERROR(INDEX(INDIRECT(AX3&"!$W:$W"),MATCH(Summary!B3,INDIRECT(AX3&"!$V:$V"),0)),"")
    IFERROR to get rid of all the #REFs

    Changed the name of the Load Bay and Food Coatings tabs - the spaces were causing problems.

    Works like a charm. Thanks guys.

  9. #9
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,929

    Re: Nested IF statements are returning FALSE values - cannot find error in code!

    you'r welcome. If this answered your question, please take a moment to mark the thread as "solved" - it helps keep things neat and tidy lol, and consider adding the reputation to those that helped (see points 2 & 3 below my 1st post to you)

+ 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. Nested IF returning FALSE value help
    By crash884 in forum Excel General
    Replies: 3
    Last Post: 08-13-2013, 01:31 PM
  2. [SOLVED] Nested IF statements to FIND text string and return set values.
    By stuartm4h in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 06-12-2013, 12:03 PM
  3. Excel 2007 : Nested IF Statements - Tracing a False Result?
    By jackinthebox in forum Excel General
    Replies: 2
    Last Post: 04-13-2010, 09:18 PM
  4. If statements: Non-numerical characters returning false when true
    By JONNY981 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 06-24-2009, 10:28 AM
  5. Returning text from nested IF and Vlookup statements
    By Patricia in forum Excel Formulas & Functions
    Replies: 14
    Last Post: 07-28-2006, 11:25 AM

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