+ Reply to Thread
Results 1 to 5 of 5

Find a Value in Row and Reference a Cell in Same Column as Value

  1. #1
    Registered User
    Join Date
    06-26-2012
    Location
    California
    MS-Off Ver
    Excel 2003
    Posts
    36

    Find a Value in Row and Reference a Cell in Same Column as Value

    Hi there,

    What I'd like to do is find the value "H" in a series of cells (let's say F3:AC3, for example) and return the value (which is a date) from row 2 of that same column. For example, if there is an "H" (a code indicating that the crop has been harvested) in cell H3, I would like Excel to return the value that is in H2. This is easy to do once, but I need it to work automatically for hundreds of different crops.

    Any ideas?

    Thank you.
    Last edited by TylerJamison; 08-14-2012 at 11:17 AM.

  2. #2
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Find a Value in Row and Reference a Cell in Same Column as Value

    Hi TylerJamison,

    You could try this - if you have a destination in mind, we could write a subroutine - it's not tested:

    Please Login or Register  to view this content.
    If I've helped you, please consider adding to my reputation - just click on the liitle star at the left.

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~(Pride has no aftertaste.)

    You can't do one thing. XLAdept

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~aka Orrin

  3. #3
    Registered User
    Join Date
    06-26-2012
    Location
    California
    MS-Off Ver
    Excel 2003
    Posts
    36

    Re: Find a Value in Row and Reference a Cell in Same Column as Value

    Where do I place this code in the spreadsheet?

  4. #4
    Registered User
    Join Date
    06-26-2012
    Location
    California
    MS-Off Ver
    Excel 2003
    Posts
    36

    Re: Find a Value in Row and Reference a Cell in Same Column as Value

    I figured it out. I ended up writing this formula:

    =IF(ISERROR(INDEX($F$2:$AC$2,MATCH("H",$F3:$AC3,0))),"-",INDEX($F$2:$AC$2,MATCH("H",$F3:$AC3,0)))

    Works perfectly.

    Thanks for your help.

  5. #5
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Find a Value in Row and Reference a Cell in Same Column as Value

    Yeah - I'm a VBA guy - you could use the function, I wrote (with a little editing) as you've used the Worksheet functions. The code would go in a Standard Module. Good that you figured it out.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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