+ Reply to Thread
Results 1 to 7 of 7

Lookup using columns and rows

  1. #1
    Forum Contributor
    Join Date
    04-11-2008
    Posts
    156

    Lookup using columns and rows

    Hi,

    Is it possible to write a lookup formula that references columns and rows where the lookup value will always be unique?

    E.g. If Sheet1 A1:A10 = Sheet2 A2 and Sheet1 B1:B10 = Sheet2 C2 and Sheet1 A1:J1 = Sheet2 D2 then return the contents of the cell from Sheet1 where the references meet.

    Thank you

  2. #2
    Forum Expert
    Join Date
    11-27-2007
    Location
    New Jersey, USA
    MS-Off Ver
    2013
    Posts
    1,669

    Re: Lookup using columns and rows

    You need to define your needs more clearly.
    In the example given, Cell A1 on sheet1 is equal to both A2 and D2 on sheet2.
    Post a sample excel file and you'll get help much faster.
    modytrane

  3. #3
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Lookup using columns and rows

    Sounds to me like your looking up a monthly matrix of some sort with two criteria columns ? Row 1 being headers (C onwards being dates perhaps ?)

    Also, please specify

    a) XL version in use

    b) data type of Sheet1!C2:J10 (text, number, mix etc...)

    If the source (sheet1) is a Pivot Table then use GETPIVOTDATA function

    If not, something like

    Please Login or Register  to view this content.
    Last edited by DonkeyOte; 10-20-2009 at 12:17 PM.

  4. #4
    Forum Contributor
    Join Date
    04-11-2008
    Posts
    156

    Re: Lookup using columns and rows

    Thank you very much for your replies.

    I actually persevered and ended up writing a formula similar to DonkeyOte's suggestion:

    =IF(ISERROR(INDEX(SourceData!$E$2:$P$1000,MATCH(OrganisedData!A2,SourceData!$A$2:$A$1000,0),MATCH(G2,SourceData!$E$1:$P$1,0))),"",INDEX(SourceData!$E$2:$P$1000,MATCH(OrganisedData!A2,SourceData!$A$2:$A$1000,0),MATCH(G2,SourceData!$E$1:$P$1,0)))

    Thanks again!

  5. #5
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Lookup using columns and rows

    So what happened to B criteria ??

    What is the data type of SourceData!E2:P1000, if consistent (text/number) you may find you can avoid double evaluation.

  6. #6
    Forum Contributor
    Join Date
    04-11-2008
    Posts
    156

    Re: Lookup using columns and rows

    Hi,

    E2:E1000 is text.

    Thanks

  7. #7
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Lookup using columns and rows

    Is the whole matrix E2:P1000 text or just E ?

    If the strings < 255 chars then you could use LOOKUP to avoid double evaluation, eg:

    Please Login or Register  to view this content.
    becomes

    Please Login or Register  to view this content.

+ 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