+ Reply to Thread
Results 1 to 11 of 11

Which Lookup function to use

Hybrid View

  1. #1
    Registered User
    Join Date
    08-18-2012
    Location
    Austin, TX
    MS-Off Ver
    Excel 2010
    Posts
    3

    Which Lookup function to use

    I have an example of what i am trying to solve at link below..
    thanks!

    Example...

    I have tried different functions but need help!
    Last edited by JBeaucaire; 08-19-2012 at 06:29 AM. Reason: Corrected thread title to topic only, as per forum rules. Do not guess at an answer in the title.

  2. #2
    Valued Forum Contributor ratcat's Avatar
    Join Date
    03-07-2008
    Location
    Rural NSW, Australia
    MS-Off Ver
    Vista 2007
    Posts
    1,111

    Re: vlookup match index or all 3? help guys!

    Please re attach your example to this site. Your link seem to be a bit dodgy
    Have I made you happy ??? If yes, please make me happy by pressing the http://www.excelforum.com/images/buttons/reputation-40b.png Add Reputation button in my post.
    Please don't forget to do the same to other contributors of this forum.

    Thanks
    I don't void confusion, I create it

  3. #3
    Registered User
    Join Date
    08-18-2012
    Location
    Austin, TX
    MS-Off Ver
    Excel 2010
    Posts
    3

    Re: vlookup match index or all 3? help guys!

    i thnk site is having issues..

    here is my file..
    thank you so so much

    http://systemwiz.net76.net/work/lookup.xls

  4. #4
    Valued Forum Contributor
    Join Date
    04-30-2012
    Location
    Australia
    MS-Off Ver
    Excel 2010
    Posts
    547

    Re: vlookup match index or all 3? help guys!

    This is a case of bad data layout. Use one table for data input, then you can easily create pivot tables with just a few clicks to show your results grouped and summed by whatever you want to highlight.

    See attached. The sheet "RawData" has all the data in one table. The next sheets have various pivot tables to sum up the data by different aspects. Pivot tables are immensely powerful. The attached sample just scratches the surface of what's possible. No formulas, just a few clicks.

    To get started with Pivot Tables, have a look at http://peltiertech.com/Excel/Pivots/pivotstart.htm
    Attached Files Attached Files
    Like a post? Click the star below it!

  5. #5
    Forum Expert
    Join Date
    06-08-2012
    Location
    Left the forum!
    MS-Off Ver
    Left the forum!
    Posts
    5,189

    Re: vlookup match index or all 3? help guys!

    There is nothing bad about the data layout, the desired result can be achieved with a fairly simple formula.

    =VLOOKUP(C3,INDEX('Weekly Sales'!$A$4:$R$13,0,MATCH($B$2,'Weekly Sales'!$A$2:$R$2,0)):'Weekly Sales'!$R$13,3,0)

  6. #6
    Valued Forum Contributor
    Join Date
    04-30-2012
    Location
    Australia
    MS-Off Ver
    Excel 2010
    Posts
    547

    Re: Which Lookup function to use

    Jason.b75, can you expand the formula gracefully to be copied down to the other names? You are using an absolute reference to $B$2, which contains the name "Bill". If you add a few rows with dates between "Bob" and "Mary", how will your formula perform then?

    This _is_ a classic case of bad data layout. Data is being gathered in a report format instead of a two-dimensional table. Basic rules of good spreadsheet design are not applied, hence the problem with reporting on the data. Sure, you can write a formula to fix up an individual case, but it's not portable and hard to expand. And it is not robust.

    A pivot table based on a two-dimensional table is hard to beat.

  7. #7
    Forum Expert
    Join Date
    06-08-2012
    Location
    Left the forum!
    MS-Off Ver
    Left the forum!
    Posts
    5,189

    Re: Which Lookup function to use

    npamcpp,

    When I looked at the sample sheet I wrote the formula based on the observation that there was emphasis on the word 'change' with the note pointing at B2, suggesting that the name would always be in the same cell.

    Would you consider this in E3 graceful?

    =IFERROR(VLOOKUP(C3,INDEX('Weekly Sales'!$A$4:$R$13,0,MATCH(LOOKUP("ZZZ",B$2:B2),'Weekly Sales'!$A$2:$R$2,0)):'Weekly Sales'!$R$13,3,0),"")

  8. #8
    Valued Forum Contributor
    Join Date
    04-30-2012
    Location
    Australia
    MS-Off Ver
    Excel 2010
    Posts
    547

    Re: Which Lookup function to use

    Jason, that's a good workaround. But compare what you've just been through to create this formula with the few clicks required to create a pivot table. Also, the formula blanks out any errors. which may not be helpful.

    This is not so much about whether or not a formula can be found to achieve the outcome. This formula is very specific and only works for the given dataset. If the dataset changes in six months time, the OP probably does not have a snowball's chance in hell adjusting it, since they don't understand how it works in the first place. Or, if another parameter is added to the mix, the formula can get really, really messy and unwieldy.

    This is about being able to maintain a scenario in the real world of changing requirements.

    With good practice spreadsheet design (i.e. raw data in one sheet, all reporting in other sheets), nobody needs to understand ANY formulas. People can just click and drag cells into position in the Pivot Table setup grid to make the required adjustments in the pivot table.

    It's never a good idea to enter data in a layout that resembles a report, because that greatly restricts the reporting capabilities the data can offer.

  9. #9
    Forum Expert
    Join Date
    06-08-2012
    Location
    Left the forum!
    MS-Off Ver
    Left the forum!
    Posts
    5,189

    Re: Which Lookup function to use

    Quote Originally Posted by npamcpp View Post
    compare what you've just been through to create this formula with the few clicks required to create a pivot table.
    I can create a formula like that quicker than I can create a pivot table

    This is about being able to maintain a scenario in the real world of changing requirements.
    It depends how the raw data is generated, it could require more work to sort the data into a format that will work with a pivot than it would to find or change a workaround.

    While I don't dispute the fact that raw data in report format can be difficult to work with, it's not impossible, while in some cases this can be the result of people not knowing a 'better' way, in others it will be the layout that suits them best for whatever reason, being different to how other people would do it doesn't make it bad practice, in my opinion it's nothing more than a case of the majority not accepting the unconventional.

  10. #10
    Valued Forum Contributor
    Join Date
    04-30-2012
    Location
    Australia
    MS-Off Ver
    Excel 2010
    Posts
    547

    Re: Which Lookup function to use

    I've never seen anyone run into trouble by separating data entry from data reporting.

    I've seen plenty of cases where people run into trouble trying to report on data presented in a report format. Hence I will always recommend separating data entry from data reporting. The workbook in this question is a classic example.

    Yes, you can construct formulas to create the desired results. Learning how these formulas work and being able to maintain them will be a much higher effort than learning how to use a few clicks to create a pivot table from a simple 2D table. I'm not disputing that YOU can create the formulas. I can, too. But it's still not good practice. Life can be a lot easier if proven, well-working techniques are applied to spreadsheet design.

    http://www.excelforum.com/tips-and-t...sign-tips.html

    If people prefer to go down the more complicated formula path, trying to report on badly laid out data, fine. I'm just trying to show a more efficient way to do it.

    Mind you, even formula solutions work with less effort from a simple 2D table.

    Last edited by npamcpp; 08-19-2012 at 08:15 AM.

  11. #11
    Registered User
    Join Date
    08-18-2012
    Location
    Austin, TX
    MS-Off Ver
    Excel 2010
    Posts
    3

    Re: Which Lookup function to use

    Wow thanks guys! Never expected a full blown discussion! You guys are awesome. Just to set the record straight i did not design this sheet! It is a good example of a spreadsheet with growing pains. Many people learn as t1hey are building a project which is not a good "101" this should have been setup as db. Buildibg in report fasion is the dark side of the force!
    Ok back to work got some sleep and ready to plow back in!

+ 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