+ Reply to Thread
Results 1 to 5 of 5

Flagging vlookup results based on which argument it came from

Hybrid View

Thom7890 Flagging vlookup results... 08-01-2018, 11:46 AM
tim201110 Re: Flagging vlookup results... 08-01-2018, 11:57 AM
MrShorty Re: Flagging vlookup results... 08-01-2018, 12:08 PM
Thom7890 Re: Flagging vlookup results... 08-01-2018, 06:40 PM
protonLeah Re: Flagging vlookup results... 08-01-2018, 07:51 PM
  1. #1
    Registered User
    Join Date
    07-09-2013
    Location
    Oshawa, Canada
    MS-Off Ver
    Excel 2010
    Posts
    29

    Flagging vlookup results based on which argument it came from

    Hello, I've created the following formula to draw vlookup data from three different tables on the 'New Held Batches Sheet' sheet.
    It checks the first table for a match and if there is an error it moves onto the next table, etc.
    Unrelatedly, it also creates a blank if the data is not on any table.

    Is there a way to flag the results based on which table the resulting data came from?

    e.g. the data came from the second table so it is blue, or the data came from the first table so it is red.


    =IFERROR(IFERROR(VLOOKUP(C2,'New Held Batches Sheet'!$C$5:$D$5,2,0),IFERROR(VLOOKUP(C2,'New Held Batches Sheet'!$C$8:$D$22,2,0),VLOOKUP(C2,'New Held Batches Sheet'!$C$25:$D$35,2,0))),"")

    Thanks for all the guidance through the years.
    If anyone has helped - Add Reputation

  2. #2
    Forum Expert tim201110's Avatar
    Join Date
    10-23-2011
    Location
    Russia
    MS-Off Ver
    2016, 2019
    Posts
    2,357

    Re: Flagging vlookup results based on which argument it came from

    =(IF(ISERR(VLOOKUP(C2,'New Held Batches Sheet'!$C$5:$D$5,2,0),,1)+IF(ISERR(VLOOKUP(C2,'New Held Batches Sheet'!$C$8:$D$22,2,0),,2)+ and so on)=1 or 2
    why not =VLOOKUP(C2,'New Held Batches Sheet'!$C$5:$D$35,2,0)?

  3. #3
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP, 2007, 2024
    Posts
    16,373

    Re: Flagging vlookup results based on which argument it came from

    Conditional formatting cannot "see" inside of the execution of a function like this. A couple of approaches:

    1) Include something in the output of the function that will indicate which table it came from. Maybe something like =IFERROR(IFERROR("a"&VLOOKUP(C2,'New Held Batches Sheet'!$C$5:$D$5,2,0),IFERROR("b"&VLOOKUP(C2,'New Held Batches Sheet'!$C$8:$D$22,2,0),"c"&VLOOKUP(C2,'New Held Batches Sheet'!$C$25:$D$35,2,0))),""). If you still need the conditional formatting, then you can have your conditional formatting check for the leading character (a, b, or c) and format accordingly. The main thing I don't like about this approach is that it adds a piece of information to the result, which could cause difficulties for other formulas that need this result.

    2) (My personal favorite) Use helper cells to return the result from each lookup. cell1 =VLOOKUP(C2,'New Held Batches Sheet'!$C$5:$D$5,2,0) cell2 =VLOOKUP(C2,'New Held Batches Sheet'!$C$8:$D$22,2,0) cell3 =VLOOKUP(C2,'New Held Batches Sheet'!$C$25:$D$35,2,0). Then a 4th cell could look at those three and return the value from the cell that is not N/A, and your conditional formatting could look at those three cells and format according to which one is not N/A.
    Quote Originally Posted by shg
    Mathematics is the native language of the natural world. Just trying to become literate.

  4. #4
    Registered User
    Join Date
    07-09-2013
    Location
    Oshawa, Canada
    MS-Off Ver
    Excel 2010
    Posts
    29

    Re: Flagging vlookup results based on which argument it came from

    Thank you for the great ideas - I think your #1 idea shorty is what will work best for me. I just need a way of personally knowing where the data came from - the formatting is unimportant.

  5. #5
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,936

    Re: Flagging vlookup results based on which argument it came from

    Alternatively, just use each of the three parts of the original formula in its own Conditional Format formula. The first applies blue fill, the second red(!), etc.
    Ben Van Johnson

+ 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. vlookup based on two results
    By Skumby in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 06-30-2016, 02:21 AM
  2. Flagging Overdue date based on two fields
    By tomb242 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 02-19-2015, 12:11 PM
  3. Using vLookup based on results from a vLookup & returning an undetermined list
    By NormalityBan in forum Excel Formulas & Functions
    Replies: 15
    Last Post: 08-14-2014, 05:02 AM
  4. Flagging different product based on 1 range
    By mmmarshman in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 06-25-2013, 12:52 PM
  5. Replies: 3
    Last Post: 07-16-2011, 11:33 AM
  6. Flagging Duplicates based on Multiple conditions
    By e4excel in forum Excel Formulas & Functions
    Replies: 28
    Last Post: 11-25-2008, 09:09 PM
  7. [SOLVED] Conditional Sum Argument results do not equal cell results Excel
    By Randy R Mullins in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 08-09-2006, 02:19 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