+ Reply to Thread
Results 1 to 8 of 8

=IF formula not working consistently

  1. #1
    Registered User
    Join Date
    11-18-2011
    Location
    Pittsburgh, PA
    MS-Off Ver
    Excel 2016
    Posts
    31

    =IF formula not working consistently

    I have the following formulas in I2 and I3 respectively":

    =IF(H2='functions DO NOT DELETE'!A:A,'functions DO NOT DELETE'!B:B,"nothing")
    =IF(H3='functions DO NOT DELETE'!A:A,'functions DO NOT DELETE'!B:B,"nothing")

    Both cells H2 and H3 contain the word "Manager". Both should contain the same result. The formula in I2 works and comes back with the correct result from the worksheet "functions DO NOT DELETE', but the second one, I3, along with all consecutive ones in the column, come back with the result "nothing" even though they should have the same result. Why does the first formula work but none of the rest?

    Changing the formula to !A$1:A$30 and !B$1:B$30 does not change the result.

  2. #2
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: =IF formula not working consistently

    An IF statement is typically set up such that a single reference is compared to a single constant or reference and returns a single response depending on whether it's true or not. You are comparing a single reference to multiple other references and asking it to return multiple other references.

    Here's how it works;
    =IF(H2='functions DO NOT DELETE'!A:A,'functions DO NOT DELETE'!B:B,"nothing")

    The first part H2='functions DO NOT DELETE'!A:A is the logical test.
    It must return either TRUE or FALSE but you have it looking at multiple cells. Assuming H2 = manager, Excel picks the value in Column A that is in the same row as the Formula. Since your formula is in row 2, it's comparing H2 to A2. The formula in I3 is looking at A3

    'functions DO NOT DELETE'!B:B is returned if the logical test is true. Do you want to return every value in column B if that is so? Are you trying to return all the corresponding values from B whenever there is "manager" in Column A? All within a single cell or copied down the column?

    Any of this helping?
    ChemistB
    My 2?

    substitute commas with semi-colons if your region settings requires
    Don't forget to mark threads as "Solved" (Edit First post>Advanced>Change Prefix)
    If I helped, Don't forget to add to my reputation (click on the little star at bottom of this post)

    Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble

  3. #3
    Registered User
    Join Date
    11-18-2011
    Location
    Pittsburgh, PA
    MS-Off Ver
    Excel 2016
    Posts
    31

    Re: =IF formula not working consistently

    Sorry, I'm just not getting it. Perhaps the attached sample will help.
    Attached Files Attached Files

  4. #4
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: =IF formula not working consistently

    Try this in I2 and filled down.

    =IFERROR(VLOOKUP(H2,'functions DO NOT DELETE'!$A$2:$B$6,2,FALSE),"nothing")

  5. #5
    Registered User
    Join Date
    11-18-2011
    Location
    Pittsburgh, PA
    MS-Off Ver
    Excel 2016
    Posts
    31

    Red face Re: =IF formula not working consistently

    My apologies...I SHOULD have known that. VLOOKUP is a basic Excel 101 function that I use every day. Thanks.

  6. #6
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: =IF formula not working consistently

    No need to apologize, that's what the forum is for.

    BTW, if you want to skip the intermediate value, and just make the formula in H return the Rank #
    you can change the formula in H2 from
    =IFERROR(LOOKUP(2^15,SEARCH('functions DO NOT DELETE'!A$1:A$6,G2),'functions DO NOT DELETE'!A$1:A$6),"")
    to
    =IFERROR(LOOKUP(2^15,SEARCH('functions DO NOT DELETE'!A$1:A$6,G2),'functions DO NOT DELETE'!B$1:B$6),"")

  7. #7
    Registered User
    Join Date
    11-18-2011
    Location
    Pittsburgh, PA
    MS-Off Ver
    Excel 2016
    Posts
    31

    Re: =IF formula not working consistently

    Thanks Jonmo1. I actually do need that intermediate value because the ranking changes from one project to the next depending on the job function.

    I appreciate your help!!

  8. #8
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: =IF formula not working consistently

    You're welcome.

+ 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] COUNTIF not working consistently
    By bishoposiris in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 02-22-2014, 11:09 AM
  2. [SOLVED] *COUNTIF with nested AND/OR -- not consistently working
    By RandomRed in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 01-31-2014, 10:26 AM
  3. [SOLVED] VLookup not working consistently
    By pjw23 in forum Excel General
    Replies: 2
    Last Post: 04-27-2012, 03:45 PM
  4. 24 hour time not working in formula consistently
    By snake in forum Excel General
    Replies: 1
    Last Post: 09-15-2011, 12:52 PM
  5. Sumproduct Formula Not Working Consistently - Date Issue
    By gav0101 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 09-19-2008, 10:30 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