+ Reply to Thread
Results 1 to 12 of 12

Vlookup with True/False

  1. #1
    Forum Contributor
    Join Date
    08-31-2010
    Location
    andover
    MS-Off Ver
    Excel 2007
    Posts
    102

    Vlookup with True/False

    Hi there.

    I have a spread sheet with various products in one column followed by a 'true' or 'false' column.

    I just want to be able to look in the true/false column, determine if its true and if so display the product.

    I was trying to do an if with vlookup in the mix but getting really confused, if anyone could provide pointers I would appreciate it.

  2. #2
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Vlookup with True/False

    Are the true and false Boolean values or are they text values?

    By default, Boolean values appear in uppercase and will be centered in the cells. Text values are aligned left by default.
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  3. #3
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: Vlookup with True/False

    So in column A you have the products. In column B you have true or false.

    So do you need a list of al products that have true in column B?
    Regards

    Fotis.

    -This is my Greek whisper to Europe.

    --Remember, saying thanks only takes a second or two. Click the little star * below, to give some Rep if you think an answer deserves it.

    Advanced Excel Techniques: http://excelxor.com/

    --KISS(Keep it simple Stupid)

    --Bring them back.

    ---See about Acropolis of Athens.

    --Visit Greece.

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

    Re: Vlookup with True/False

    A Vlookup will only return the first value it finds that has either a true or false. So if you want to find all products that are true OR false perhaps you might want to use a filter?
    Make contributors happy, click on the "* Add Reputation" as a way to say thank you.
    Sam Capricci

  5. #5
    Forum Contributor
    Join Date
    08-31-2010
    Location
    andover
    MS-Off Ver
    Excel 2007
    Posts
    102

    Re: Vlookup with True/False

    Hi yes they are bolean I guess in that its all upper case and centered, this has been pulled from an access database that is a tick box

    I can't adjust the columns or anything, so basically the column headers are 'product', 'active', 'price', 'quantity'

    The pain being two fold, working with that TRUE FALSE in the active column, and if true, it returning back the the other columns

    Thanks for any help, I have been scratching my head for days, but I understand this forum took a bit of a beating so it was unreachable.

  6. #6
    Forum Contributor
    Join Date
    08-31-2010
    Location
    andover
    MS-Off Ver
    Excel 2007
    Posts
    102

    Re: Vlookup with True/False

    IN response to Sambo, the plan was to have copy the formula down the page so it looks at each row of the sheet.

  7. #7
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Vlookup with True/False

    Is this what you had in mind...

    Data Range
    A
    B
    C
    D
    1
    Product
    Active
    Product
    2
    Soup
    FALSE
    Ice Cream
    3
    Candy
    FALSE
    Bacon
    4
    Ice Cream
    TRUE
    Carrots
    5
    Bacon
    TRUE
    Bread
    6
    Chicken
    FALSE
    Noodles
    7
    Carrots
    TRUE
    8
    Peas
    FALSE
    9
    Bread
    TRUE
    10
    Noodles
    TRUE

    This array formula** entered in D2:

    =IFERROR(INDEX(A:A,SMALL(IF(B$2:B$10,ROW(B$2:B$10)),ROWS(D$2:D2))),"")

    ** array formulas need to be entered using the key
    combination of CTRL,SHIFT,ENTER (not just ENTER).
    Hold down both the CTRL key and the SHIFT key
    then hit ENTER.

    Copy down until you get blanks.

  8. #8
    Forum Contributor
    Join Date
    08-31-2010
    Location
    andover
    MS-Off Ver
    Excel 2007
    Posts
    102

    Re: Vlookup with True/False

    Thanks Tony, will give it a go

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

    Re: Vlookup with True/False

    This is a way to do a backward vlookup =IFERROR(VLOOKUP($D$236,CHOOSE({1,2},B236,A236),2,0),"") where "TRUE" is in cell D236, the product (like auto) is in column A, the true/false value is in col B and it looks at it one row at a time. It worked for me and I didn't have to restructure columns.
    I always have troubles with index (wish I could use it but...) so, anyway, if you're interested.

  10. #10
    Forum Contributor
    Join Date
    08-31-2010
    Location
    andover
    MS-Off Ver
    Excel 2007
    Posts
    102

    Re: Vlookup with True/False

    That got it tony, and lets face it I wouldn't have arrived at that ever! I can pick up the V lookup based on that result now, nice.

  11. #11
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Vlookup with True/False

    You're welcome. Thanks for the feedback!

  12. #12
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: Vlookup with True/False

    Based on your last post in this thread, its apparent that you are satisfied with the solution(s) you've received and have solved your question, but you haven't marked your thread as "SOLVED",as per our Forum Rule #9. I will do it for you this time.

    In future, to mark your thread as Solved, you can do the following -
    Select Thread Tools-> Mark thread as Solved.

    Incase your issue is not solved, you can undo it as follows -
    Select Thread Tools-> Mark thread as Unsolved.

    Also, since you are relatively new to the forum, i would like to inform you that you can thank those who have helped you by clicking the small star icon located in the lower left corner of the post which helped you. This adds to the reputation of the person who has taken the time to help 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. Vlookup to report True or false
    By Dendrinos2 in forum Excel General
    Replies: 1
    Last Post: 11-30-2011, 12:04 PM
  2. vlookup return True/False
    By okl in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 10-13-2009, 06:47 AM
  3. [SOLVED] Search for 2 true arguments and return true or false
    By David in forum Excel General
    Replies: 3
    Last Post: 07-15-2006, 05:20 AM
  4. Function to return True/False if all are validated as True by ISNU
    By Tetsuya Oguma in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 03-15-2006, 06:30 AM
  5. vlookup, true false issue
    By pjjclark in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 02-06-2006, 04:10 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