+ Reply to Thread
Results 1 to 7 of 7

Find value in row and retrieve adjacent cell

  1. #1
    Registered User
    Join Date
    06-10-2014
    Location
    New York, NY
    MS-Off Ver
    Office 2010
    Posts
    13

    Find value in row and retrieve adjacent cell

    Hi Everyone,

    I'm having a problem that has been plaguing me for some time.

    I have a spreadsheet of Years, with the cost associated with each year for each particular entry (row). Each row has a different set of years in each column, but I am looking to return the amount for a specified year in just one column at the end.

    Before I confuse you more, maybe the attached spreadsheet will help explain.

    Lookup in Array.xlsx

    I have manually populated Column L to illustrate what I am trying to do. Does anyone happen to know a formula that can do this?

    Happy to answer any questions if I can help clarify.

    Thank you.
    Last edited by DigDoug; 09-11-2014 at 03:13 PM.

  2. #2
    Valued Forum Contributor
    Join Date
    07-07-2014
    Location
    Washington DC
    MS-Off Ver
    2007
    Posts
    1,047

    Re: Find value in row and retrieve adjacent cell

    Column L in the file you posted is blank. Did you manually populate Column K?

  3. #3
    Valued Forum Contributor
    Join Date
    07-07-2014
    Location
    Washington DC
    MS-Off Ver
    2007
    Posts
    1,047

    Re: Find value in row and retrieve adjacent cell

    Also, does the data need to stay organized as you have it? Or can it be rearranged? It'd be much easier if the data could be organized into two columns.

  4. #4
    Registered User
    Join Date
    06-27-2013
    Location
    Boulder, CO
    MS-Off Ver
    Excel 2007
    Posts
    99

    Re: Find value in row and retrieve adjacent cell

    =SUMIF(Table2[[#This Row],[Year 1]],K$1,Table2[[#This Row],[Amount]])+SUMIF(Table2[[#This Row],[Year 2]],K$1,Table2[[#This Row],[Amount2]])+SUMIF(Table2[[#This Row],[Year 3]],K$1,Table2[[#This Row],[Amount3]])+SUMIF(Table2[[#This Row],[Year 4]],K$1,Table2[[#This Row],[Amount4]])+SUMIF(Table2[[#This Row],[Year 5]],K$1,Table2[[#This Row],[Amount5]])

    This is the formula I used and it can be copied across multiple columns to account for more years to come.

    Hope that helps.

    -Z

  5. #5
    Registered User
    Join Date
    06-10-2014
    Location
    New York, NY
    MS-Off Ver
    Office 2010
    Posts
    13

    Re: Find value in row and retrieve adjacent cell

    Quote Originally Posted by hoyasaxa215 View Post
    Column L in the file you posted is blank. Did you manually populate Column K?
    Yes, Sorry about that. I mentioned the column in an older version of the sheet I was using.

    Nice to see a fellow georgetown alum!

  6. #6
    Registered User
    Join Date
    06-10-2014
    Location
    New York, NY
    MS-Off Ver
    Office 2010
    Posts
    13

    Re: Find value in row and retrieve adjacent cell

    Quote Originally Posted by Zodeeak View Post
    =SUMIF(Table2[[#This Row],[Year 1]],K$1,Table2[[#This Row],[Amount]])+SUMIF(Table2[[#This Row],[Year 2]],K$1,Table2[[#This Row],[Amount2]])+SUMIF(Table2[[#This Row],[Year 3]],K$1,Table2[[#This Row],[Amount3]])+SUMIF(Table2[[#This Row],[Year 4]],K$1,Table2[[#This Row],[Amount4]])+SUMIF(Table2[[#This Row],[Year 5]],K$1,Table2[[#This Row],[Amount5]])

    This is the formula I used and it can be copied across multiple columns to account for more years to come.

    Hope that helps.

    -Z
    Thanks, this worked and was something I was thinking about as well. I was just hoping that there would be a "prettier" solution code-wise.

  7. #7
    Registered User
    Join Date
    06-27-2013
    Location
    Boulder, CO
    MS-Off Ver
    Excel 2007
    Posts
    99

    Re: Find value in row and retrieve adjacent cell

    There will likely always be a more elegant way to do things when I post something. I just use what little I know and works for me.

    -Z

+ 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] How to Find a Matching Pattern and Retrieve Data from the Adjacent Column
    By Saarang84 in forum Excel Formulas & Functions
    Replies: 16
    Last Post: 06-10-2014, 09:58 PM
  2. Macro to find cell value in column and retrieve duplicates
    By wwballar42 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-05-2014, 06:45 PM
  3. Coding to Find Cell and Retrieve Row and Column Numbers
    By chaplaindoug in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-10-2013, 01:18 PM
  4. To find the number of occurrences based on the cell condition and retrieve the value
    By rsundarmail77 in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 12-02-2011, 11:50 AM
  5. [SOLVED] Macro to find and retrieve cell contents
    By DancingElvisLives in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-31-2011, 09:33 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