+ Reply to Thread
Results 1 to 8 of 8

Find the first instance of a value, and return the value of the cell next to it.

  1. #1
    Registered User
    Join Date
    02-11-2009
    Location
    Salt Lake City, Utah
    MS-Off Ver
    Excel 2010
    Posts
    98

    Find the first instance of a value, and return the value of the cell next to it.

    I need a function that returns the value of a cell, triggered by a positive identification of a value in the cell one column left of the target cell.

    In the spreadsheet attached, I get the list of information from an instrument that auto generates a excel report.

    I take the info and copy it and paste it into this spreadsheet.

    I want the cells under the red "Inj Volume" to auto find the Calibration levels "1, 2, 3, 4" and return the value of the cells right next to those levels.

    So, the first cell under the red "Inj Volume" would return "5.00" and the second cell should return "10.00." The catch is, sometimes the list changes row position (column position remains constant).

    The 2 tabs are 2 different lists, as an example.
    Attached Files Attached Files
    Excel: Not my profession, but useful in it.

  2. #2
    Registered User
    Join Date
    10-10-2015
    Location
    Houston
    MS-Off Ver
    2013
    Posts
    26

    Re: Find the first instance of a value, and return the value of the cell next to it.

    Is this what you are looking for
    Attached Files Attached Files

  3. #3
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,197

    Re: Find the first instance of a value, and return the value of the cell next to it.

    Try ..

    =VLOOKUP("1",$E$9:$F$15,2,0)

    change "1" to "2", "3","4"

  4. #4
    Registered User
    Join Date
    02-11-2009
    Location
    Salt Lake City, Utah
    MS-Off Ver
    Excel 2010
    Posts
    98

    Re: Find the first instance of a value, and return the value of the cell next to it.

    Thanks John, that works.

    I almost expected a Vlookup answer, but I don't understand enough about them to craft it very well. When I read the excel help files, it's too technical for me to understand well, but I think I might be getting a little better handle of it now.

    So, as I understand it, the 1st position is "1" and looks for the value 1. (or 2 or whatever I'm looking for)
    The 2nd position means it looks at the leftmost column of the 2 columns selected
    The 3rd position is to return the value from column "2" of the 2 columns selected
    The 4th position... not sure what that does...

    Am I understanding it right, and what does that 4th item do?
    Last edited by timmtamm; 10-26-2015 at 06:33 PM.

  5. #5
    Registered User
    Join Date
    02-11-2009
    Location
    Salt Lake City, Utah
    MS-Off Ver
    Excel 2010
    Posts
    98

    Re: Find the first instance of a value, and return the value of the cell next to it.

    Thanks garfield. Your solution works as well, but I do not understand how it works at all. What is the equation doing? Can you explain it for me?

    All I know is if I change the 1 to 2, it changes which one it is looking at.

    According to the excel help file, the "sumproduct" function multiplies things, and then adds them, and non-value amounts equal 0. This is being used very differently by you. I'd like to understand it. Can you explain it?

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

    Re: Find the first instance of a value, and return the value of the cell next to it.

    Quote Originally Posted by timmtamm View Post
    According to the excel help file, the "sumproduct" function multiplies things, and then adds them, and non-value amounts equal 0. This is being used very differently by you. I'd like to understand it. Can you explain it?
    SUMPRODUCT is a very powerful function.

    See this for lots of useful info:

    http://xldynamic.com/source/xld.SUMPRODUCT.html
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  7. #7
    Registered User
    Join Date
    10-10-2015
    Location
    Houston
    MS-Off Ver
    2013
    Posts
    26

    Re: Find the first instance of a value, and return the value of the cell next to it.

    Check out this video

    https://www.youtube.com/watch?v=hphM...36yNhWBb0f-nci

    Its a very thorough video on SUMPRODUCT and ExcelIsFun does a much better job of explaining than I ever could.

  8. #8
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,197

    Re: Find the first instance of a value, and return the value of the cell next to it.

    Yes, you are right.

    =VLOOKUP("1",$E$9:$F$15,2,0)

    "1" is the value we are looking up

    $E$9:$F$15 is the range where we search; the first range (E in this case) must be the one containing the lookup value.

    2 tells us the return the value from the second range (F); $E$9:$H$15 with value 3 will return value from column G.

    0 (FALSE) tells us to find the exact match. 1 (TRUE) will find the closest match with data in ascending order.

+ 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. Using VBA, want to return 2nd instance of a lookup value
    By thecdnmole in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-07-2015, 01:42 PM
  2. [SOLVED] To Find every instance of TEXT copy, repeat until no Find found
    By DadaaP in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-25-2013, 02:15 PM
  3. Return adjacent cell value of first instance of a value in a list
    By dstockydale in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 02-19-2013, 08:51 PM
  4. Return the instance of the value in the column in the next cell
    By witcomm in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-21-2012, 04:58 AM
  5. Replies: 2
    Last Post: 01-14-2008, 06:13 PM
  6. [SOLVED] Return only one instance
    By Pat in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 03-09-2005, 07:06 PM
  7. Return only 1 instance in a list
    By jarvo in forum Excel General
    Replies: 4
    Last Post: 03-04-2005, 06:03 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