+ Reply to Thread
Results 1 to 5 of 5

Lookup Question

  1. #1
    Forum Contributor
    Join Date
    02-08-2005
    MS-Off Ver
    Microsoft 365
    Posts
    812

    Lookup Question

    Hi,

    Apologies, this is related to my earlier post. I've created a new one as I couldn't see how to add a file when I edited the post. Hopefully this one is more clear too!

    Sample source data is in columns A to C, and the lookup table is in columns G to I.

    In the lookup table I’m trying to extract the value from column C that is associated with the product and country indicated in columns G and H.

    The difficulty is how to deal with the blank in cell C6 as, in this example, a blank is not the same thing as a zero.

    Can someone please suggest how I can amend the formulae in column I to accommodate the distinction between a blank cell and one containing the number zero.

    Thanks very much!
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    03-23-2004
    Location
    London, England
    MS-Off Ver
    Excel 2019
    Posts
    7,065

    Re: Lookup Question

    This will do the same thing

    =VLOOKUP(G2,IF(B$2:B$7=H2,A$2:C$7),3)
    Array formula, use Ctrl-Shift-Enter

    But you have the same problem, no distinguishing between 0 and a blank.
    Trouble is, as soon as the VLOOKUP determines it's a blank it gets converted to zero.
    Can't presently think of a way round this.
    Regards
    Special-K

    Ensure you describe your problem clearly, I have little time available to solve these problems and do not appreciate numerous changes to them.

  3. #3
    Forum Expert sweep's Avatar
    Join Date
    04-03-2007
    Location
    Great Sankey, Warrington, UK
    MS-Off Ver
    2003 / 2007 / 2010 / 2016 / 365
    Posts
    3,445

    Re: Lookup Question

    Hi,

    This array formula works for your example

    Please Login or Register  to view this content.
    Confirm with CTRL, SHIFT and ENTER
    Rule 1: Never merge cells
    Rule 2: See rule 1

    "Tomorrow I'm going to be famous. All I need is a tennis racket and a hat".

  4. #4
    Forum Expert GeneralDisarray's Avatar
    Join Date
    09-15-2011
    Location
    Pittsburgh, PA, USA
    MS-Off Ver
    Windows Excel 2016
    Posts
    1,416

    Re: Lookup Question

    This is a bit long, but it will do what you what:

    =CHOOSE((SUMPRODUCT(($A$2:$A$7=$G3)*($B$2:$B$7=$H3)*($C$2:$C$7=""))>0)*1+1,SUMPRODUCT(($A$2:$A$7=$G3)*($B$2:$B$7=$H3)*$C$2:$C$7),"")

    The part in red is there just to figure out if you have a 'blank' case - if so a blank is returned. Otherwise, your usual function (in blue) is calculated.
    Remember, saying thanks only takes a second or two. Click the star icon(*) below the post you liked, to give some Rep if you think an answer deserves it.

    Please,mark your thread [SOLVED] if you received your answer.

  5. #5
    Forum Contributor
    Join Date
    02-08-2005
    MS-Off Ver
    Microsoft 365
    Posts
    812

    Re: Lookup Question

    Thanks very much!

+ 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] Lookup question matching part of lookup value in the table array
    By kosmo in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 09-05-2013, 11:07 AM
  2. Lookup Question - Possible to match if the cell *contains* the lookup value?
    By AdamParker in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 07-15-2011, 03:30 PM
  3. Lookup / Sum question
    By DanBaker in forum Excel General
    Replies: 3
    Last Post: 03-11-2009, 10:32 PM
  4. Lookup question
    By NextByte in forum Excel - New Users/Basics
    Replies: 16
    Last Post: 11-07-2007, 09:31 PM
  5. [SOLVED] LOOKUP question-s it possible to have LOOKUP do a calculation in the array?
    By Bob S in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 01-12-2006, 09:30 AM
  6. Lookup question
    By Ntisch in forum Excel General
    Replies: 4
    Last Post: 06-27-2005, 02:00 AM
  7. [SOLVED] Lookup Question
    By Mackay 1979 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 02-19-2005, 10:06 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