+ Reply to Thread
Results 1 to 10 of 10

vlookup/hlookup, or what?

  1. #1
    Registered User
    Join Date
    06-10-2016
    Location
    amsterdam
    MS-Off Ver
    2010
    Posts
    5

    vlookup/hlookup, or what?

    Hello all, I have a lookup problem.

    I try to lookup a certain value which can be found in column A:T (in one certain row), and then display field Z of that certain row.

    So lookup Marc and display 5.

    john mia seth marc eva 5

    Any ideas?

    Thanks!
    Martijn

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

    Re: vlookup/hlookup, or what?

    Perhaps

    =IF(COUNTIF(A1:T1,"Marc"),Z1,"")

  3. #3
    Registered User
    Join Date
    06-10-2016
    Location
    amsterdam
    MS-Off Ver
    2010
    Posts
    5

    Re: vlookup/hlookup, or what?

    gone try that, thanks. But does it work if I have 100 rows and the "marc" will be in one of those 100?

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

    Re: vlookup/hlookup, or what?

    No, I took your statement "in one certain row" to mean that you already knew which row marc was in.

    So you're saying then that Marc could be anywhere in A:T ?
    Will Marc only appear ONCE in the entire range?
    If it could be multiple times, which one do you want to use?

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

    Re: vlookup/hlookup, or what?

    Quote Originally Posted by spectral75 View Post
    gone try that, thanks. But does it work if I have 100 rows and the "marc" will be in one of those 100?
    Assuming that Marc appears only once...

    Array entered**:

    =INDEX(X2:X100,MAX(IF(A2:T100="Marc",ROW(A2:T100)))-ROW(A2)+1)

    ** 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.
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  6. #6
    Registered User
    Join Date
    06-10-2016
    Location
    amsterdam
    MS-Off Ver
    2010
    Posts
    5

    Re: vlookup/hlookup, or what?

    I dont know in which row Marc will appear, and yes it will only be once.

  7. #7
    Registered User
    Join Date
    06-10-2016
    Location
    amsterdam
    MS-Off Ver
    2010
    Posts
    5

    Re: vlookup/hlookup, or what?

    Quote Originally Posted by Tony Valko View Post
    Assuming that Marc appears only once...

    Array entered**:

    =INDEX(X2:X100,MAX(IF(A2:T100="Marc",ROW(A2:T100)))-ROW(A2)+1)

    ** 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.
    Thanks, but somehow I keep getting #value!

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

    Re: vlookup/hlookup, or what?

    I can see 3 possible causes for that formula to return #Value!

    1. You didn't enter it with CTRL + SHIFT + ENTER
    It's an array formula that requires special keystrokes to enter it.
    Instead of just pressing enter after typing in the formula, you press CTRL + SHIFT + ENTER
    You will know when it's correclty entered when you see the formula surronded by {brackets}

    2. There are no cells in the range 'exactly' equal to "Marc"
    Check the cells for correct spelling and Extra Spaces like " Marc" or "Marc "

    3. There are other pre-existing formulas in the range that are resulting in #Value! errors.

  9. #9
    Registered User
    Join Date
    06-10-2016
    Location
    amsterdam
    MS-Off Ver
    2010
    Posts
    5

    Re: vlookup/hlookup, or what?

    Yeah there was a formula somewhere, now it seems to work. Thanks!

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

    Re: vlookup/hlookup, or what?

    Good deal. Thanks for the feedback!

+ 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. Help with Vlookup or Hlookup
    By albert1992 in forum Excel General
    Replies: 4
    Last Post: 07-20-2015, 12:48 AM
  2. VLOOKUP within HLOOKUP
    By Mearsy in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 05-11-2015, 09:52 AM
  3. hlookup/vlookup
    By Sirishgreen in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 11-29-2007, 10:47 AM
  4. vlookup - hlookup
    By Superslinky in forum Excel General
    Replies: 5
    Last Post: 11-13-2007, 05:25 PM
  5. Vlookup & Hlookup together?
    By Joanie in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 09-20-2006, 12:26 PM
  6. vlookup and hlookup
    By hotelmasters in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 08-15-2006, 03:45 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