+ Reply to Thread
Results 1 to 11 of 11

Complicated value lookup

  1. #1
    Registered User
    Join Date
    05-04-2006
    Posts
    5

    Complicated value lookup

    I have a set of data in this format:

    a x 12
    b x 14
    c x 18
    a y etc.
    b y
    c y
    a z
    b z
    c z

    And i want it in this table format:
    x y z
    a # # #
    b # # #
    c # # #


    What is the relevant formulae? I've tried some mashups of offset, index and match to no avail.

    An example spreadsheet is attached if you want to have a go.

    Cheers,
    TF
    Attached Files Attached Files

  2. #2
    Forum Contributor
    Join Date
    03-23-2006
    Location
    Vancouver
    Posts
    114

    Re: Complicated lookup

    The easiest way to achieve your result would be as follows:

    Insert an additional column between COLUMN and VALUE

    In cell C3 enter formula =A3&B3

    In cell H4 enter formula =VLOOKUP(G4&H$3,$C:$D,2,FALSE)

  3. #3
    Registered User
    Join Date
    02-01-2006
    Posts
    60

    Pivot Table maybe?

    Hi,

    I think a pivot table might me easier.

    Higlight the range of cells (A2 to C11).
    Click Data > Pivot Table > Next > Next > Layout.

    Drag the Row button to the Row section of the Pivot table, Column button to Column section and Value to the data section (make sure it says "Sum of Value")
    Click OK > Finish and you should get the results you need.

    Thanks
    gazzr

  4. #4
    Registered User
    Join Date
    02-01-2006
    Posts
    60

    I like it!

    Thats good Quattro, I'll make a note of that Vlookup formula.

    Gazzr

  5. #5
    Registered User
    Join Date
    05-04-2006
    Posts
    5

    Thumbs up

    Thanks Heaps Captain Quattro and Gazzr!
    Both methods work (and are very easy) compared to what i was trying to do.
    Virtual Beers all round!
    Cheers,
    TF

  6. #6
    Registered User
    Join Date
    05-04-2006
    Posts
    5
    Arghhh!

    Just when i thought it was all hunky dory!

    Pivot table method:
    In the data i am now applying it too, the pivot table is too large to fit on one worksheet (whichever way i do it).
    I could probably do two pivot tables after splitting the table, but it doesn't seem very neat.
    It also alphabetised the column data as well, which is not desirable, and my guess at a workaround is not very neat either.

    &,Vlookup method:
    There is not a data point for every possible combination of the data. If there is no data, the default should be zero. Since the formula returns N/A, i can't make an easy formula out of this. I am planning to do a two step process - a first table with N/A's in it, and a second table that uses info from the first table to put zeros instead of N/A's. Neater solutions anyone?

    Cheers,
    TF

  7. #7
    Dominic
    Guest

    Re: Complicated value lookup

    You could probably nest the Captain's lookup formula in an if statement:

    =if(isna(VLOOKUP(G4&H$3,$C:$D,2,FALSE)),"",VLOOKUP(G4&H$3,$C:$D,2,FALSE))

    Untested but looks like it should work. ;-)

    "TheFarmer42" wrote:

    >
    > Arghhh!
    >
    > Just when i thought it was all hunky dory!
    >
    > Pivot table method:
    > In the data i am now applying it too, the pivot table is too large to
    > fit on one worksheet (whichever way i do it).
    > I could probably do two pivot tables after splitting the table, but it
    > doesn't seem very neat.
    > It also alphabetised the column data as well, which is not desirable,
    > and my guess at a workaround is not very neat either.
    >
    > &,Vlookup method:
    > There is not a data point for every possible combination of the data.
    > If there is no data, the default should be zero. Since the formula
    > returns N/A, i can't make an easy formula out of this. I am planning to
    > do a two step process - a first table with N/A's in it, and a second
    > table that uses info from the first table to put zeros instead of
    > N/A's. Neater solutions anyone?
    >
    > Cheers,
    > TF
    >
    >
    > --
    > TheFarmer42
    > ------------------------------------------------------------------------
    > TheFarmer42's Profile: http://www.excelforum.com/member.php...o&userid=34102
    > View this thread: http://www.excelforum.com/showthread...hreadid=538751
    >
    >


  8. #8
    Registered User
    Join Date
    05-04-2006
    Posts
    5
    Thanks Dominic, that works.
    I'd tried isna() before, but it didn't work - my syntax gets a bit dodgy too late in the day!

  9. #9
    Dominic
    Guest

    Re: Complicated value lookup

    You're welcome Farmer.

    Glad you got it worked out. Captain's vlookup was pretty slick.

    "TheFarmer42" wrote:

    >
    > Thanks Dominic, that works.
    > I'd tried isna() before, but it didn't work - my syntax gets a bit
    > dodgy too late in the day!
    >
    >
    > --
    > TheFarmer42
    > ------------------------------------------------------------------------
    > TheFarmer42's Profile: http://www.excelforum.com/member.php...o&userid=34102
    > View this thread: http://www.excelforum.com/showthread...hreadid=538751
    >
    >


  10. #10
    Registered User
    Join Date
    05-04-2006
    Posts
    5
    You may be interested (or not) in what I used the techniques learned here for. It was to establish a method of taking old (legacy) Linear programming models in the common MPS format and making them available for editing and solving in Excel.

    http://www.johnquiggin.com/rsmg/wordpress/?p=28

    Cheers,
    TF

  11. #11
    Dominic
    Guest

    Re: Complicated value lookup

    Very nice. Looks like a big brain cramp.

    Thanks for sharing.

    "TheFarmer42" wrote:

    >
    > You may be interested (or not) in what I used the techniques learned
    > here for. It was to establish a method of taking old (legacy) Linear
    > programming models in the common MPS format and making them available
    > for editing and solving in Excel.
    >
    > http://www.johnquiggin.com/rsmg/wordpress/?p=28
    >
    > Cheers,
    > TF
    >
    >
    > --
    > TheFarmer42
    > ------------------------------------------------------------------------
    > TheFarmer42's Profile: http://www.excelforum.com/member.php...o&userid=34102
    > View this thread: http://www.excelforum.com/showthread...hreadid=538751
    >
    >


+ 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