+ Reply to Thread
Results 1 to 11 of 11

My brain hurts - Help creating multi-step array/lookup

  1. #1
    Registered User
    Join Date
    10-03-2014
    Location
    Wisconsin
    MS-Off Ver
    2013
    Posts
    15

    My brain hurts - Help creating multi-step array/lookup

    Greetings,

    My problem is reasonably simple to describe, but I haven't found a good way to deal with it other than creating a "helper" sheet, which takes up too much ram, given the amount of data.

    I have three sheets, summary, data, and reference.

    In data, I have columns: Name and Amount.
    In reference, I have: Name and Class.

    I want one formula I can use to average the amounts for names in a certain class. Thus, I copy and paste the data in my "data" sheet, and in my "summary" sheet create averages for the listed class.

    For example, let's say I paste the following into the data sheet:

    Milwaukee 8
    Madison 4
    Chicago 11
    Springfield 16
    Des Moines 22

    In my "reference" sheet, which stays static, I have:

    Milwaukee Wisconsin
    Madison Wisconsin
    Chicago Illinois
    Springfield Illinois
    Des Moines Iowa

    In my "summary" sheet, I have columns for Wisconsin, Illinois, and Iowa, and I want to return the average for each from the data I paste. I want to do this in a single formula, if possible, because I'm dealing with 700,000+ entries and creating a helper sheet makes the document impossible to deal with.

    Any thoughts?

  2. #2
    Valued Forum Contributor
    Join Date
    04-09-2013
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2010
    Posts
    391

    Re: My brain hurts - Help creating multi-step array/lookup

    Hi,

    This looks like an ideal problem for Power Pivot, since you are on 2013.
    Try it out.

    Regards,

  3. #3
    Forum Guru samba_ravi's Avatar
    Join Date
    07-26-2011
    Location
    Hyderabad, India
    MS-Off Ver
    Excel 2021
    Posts
    8,914

    Re: My brain hurts - Help creating multi-step array/lookup

    Attach sample file
    Samba

    Say thanks to those who have helped you by clicking Add Reputation star.

  4. #4
    Valued Forum Contributor
    Join Date
    01-19-2012
    Location
    Barrington, IL
    MS-Off Ver
    Excel 2007/2010
    Posts
    1,211

    Re: My brain hurts - Help creating multi-step array/lookup

    You could add a VLOOKUP column to the data sheet,

    =VLOOKUP(City,ReferenceSheet,2,0)

    Then just use a SUMIF on those VLOOKUPs with a sum_range of the numbers

    No helper sheet, a helper column shouldn't increase size all that much


    If the tables are:

    In A1:B5
    Please Login or Register  to view this content.
    In A8:B12
    Please Login or Register  to view this content.
    You can use in C1:C5:
    =VLOOKUP(A1,$A$8:$B$12,2,0)

    Then in C8:C12
    =SUMIF($C$1:$C$5,B8,$B$1:$B$5)
    Last edited by Speshul; 10-23-2014 at 02:29 PM.
    You should hit F5, because chances are I've edited this post at least 5 times.
    Example of Array Formulas
    Quote Originally Posted by Jacc View Post
    Sorry, your description makes no sense. I just made some formula that looks interesting cause I had nothing else to do.
    Click the * below on any post that helped you.

  5. #5
    Registered User
    Join Date
    10-03-2014
    Location
    Wisconsin
    MS-Off Ver
    2013
    Posts
    15

    Re: My brain hurts - Help creating multi-step array/lookup

    Quote Originally Posted by Speshul View Post
    You could add a VLOOKUP column to the data sheet,

    =VLOOKUP(City,ReferenceSheet,2,0)

    Then just use a SUMIF on those VLOOKUPs with a sum_range of the numbers

    No helper sheet, a helper column shouldn't increase size all that much
    Thank you, but that's what I'm doing now. With nearly a million VLOOKUP's (for this function alone) it routinely freezes.

  6. #6
    Registered User
    Join Date
    10-03-2014
    Location
    Wisconsin
    MS-Off Ver
    2013
    Posts
    15

    Re: My brain hurts - Help creating multi-step array/lookup

    Quote Originally Posted by nflsales View Post
    Attach sample file
    Thanks, here's a quick sample.

    Sample.xlsx

  7. #7
    Valued Forum Contributor
    Join Date
    01-19-2012
    Location
    Barrington, IL
    MS-Off Ver
    Excel 2007/2010
    Posts
    1,211

    Re: My brain hurts - Help creating multi-step array/lookup

    Edit: Automatic calculation was turned off, nevermind

    This works if you enter it into two cells at the same time, not when you put it in only one. not 100% sure why.

    Use Control + Shift + Enter to enter this Array Formula
    =AVERAGE(--(VLOOKUP(Data!$A$2:$A$19,Reference!$A$2:$B$8,2,0)=Summary!A2)*Data!$B$2:$B$19)

    (Enter into B2 and C2 at the same time, then drag down)


    Edit again,

    Since I have to enter in multiple cells might as well make it do something useful. Try this in cells B2, and C2 at the same time, control + Shift + Enter
    B2 will be Average, C2 is the SUM.

    Please Login or Register  to view this content.
    Last edited by Speshul; 10-23-2014 at 03:42 PM.

  8. #8
    Registered User
    Join Date
    10-03-2014
    Location
    Wisconsin
    MS-Off Ver
    2013
    Posts
    15

    Re: My brain hurts - Help creating multi-step array/lookup

    Sorry, they shouldn't all be in Wisconsin. I'm not sure why you're seeing that.

    No, it doesn't work unfortunately.

  9. #9
    Valued Forum Contributor
    Join Date
    01-19-2012
    Location
    Barrington, IL
    MS-Off Ver
    Excel 2007/2010
    Posts
    1,211

    Re: My brain hurts - Help creating multi-step array/lookup

    I edited the original formula, I noticed that automatic calculating wasn't enabled, that's why I was getting only Wisconsin results for everything. The formula has been adjusted and calculated accurately on your sample sheet when entered as stated (see above post!)

  10. #10
    Forum Expert azumi's Avatar
    Join Date
    12-10-2012
    Location
    YK, Indonesia
    MS-Off Ver
    Excel 2019
    Posts
    2,367

    Re: My brain hurts - Help creating multi-step array/lookup

    Perhaps something like this? Using array formula, pls find the file attach
    Attached Files Attached Files

  11. #11
    Valued Forum Contributor
    Join Date
    04-09-2013
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2010
    Posts
    391

    Re: My brain hurts - Help creating multi-step array/lookup

    Hi,

    See the attached file, as per my initial suggestion of Power Pivot.
    Attached Files Attached Files

+ 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. my brain hurts!!!!
    By scooby_514 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 09-07-2014, 04:07 PM
  2. Brain fried - help with choosiing and creating lookup
    By PhillyG in forum Excel General
    Replies: 7
    Last Post: 06-13-2014, 11:54 AM
  3. My brain hurts. need help figuring this out.
    By Bajungadustin in forum Excel General
    Replies: 2
    Last Post: 06-12-2011, 08:26 PM
  4. Replies: 13
    Last Post: 07-19-2006, 12:35 PM
  5. [SOLVED] My brain hurts...
    By Buttaflye in forum Excel General
    Replies: 2
    Last Post: 05-10-2005, 02:06 PM

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