+ Reply to Thread
Results 1 to 17 of 17

lookup a range of data then sum totals on another sheet in order

  1. #1
    Registered User
    Join Date
    08-16-2011
    Location
    australia
    MS-Off Ver
    Excel 2013
    Posts
    40

    lookup a range of data then sum totals on another sheet in order

    Hi All,

    I have a spreadsheet that I would like some help with.
    I have a range of data that relates to an order and the amount for that order.
    I would like to somehow sum the order amounts and show the total on another sheet, but also split them depending on the category.

    e.g. Sheet 1 shows the data I start with (always copied from another workbook) column A is the order name column B is the ordered amount.
    sheet 2 shows the categories in bold with the corresponding order names of the category they belong in, ( columns E to I)

    I would like to be able to look up the names within the category (from sheet 1), sum the total and put the answer into column B next to the category name in column A.

    I have had some experience with formulas, but looking up values and summing them has me puzzled.

    I appreciate any help on this

    Thanks
    Attached Files Attached Files

  2. #2
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: lookup a range of data then sum totals on another sheet in order

    Hi,

    As it stands this will be an extremely awkard task, since you do not appear to have exact matches between the Order Names across both sheets, e.g. Broken Hill Milk in Sheet1 but BROKEN HILL in Sheet2, KI Experience Food Distribution PL in Sheet1 but KI EXPERIENCE in Sheet2, etc., etc.

    Unless you can redo your workbook so that these matches are exact, then it will necessitate a solution involving 'fuzzy' matching, which is relatively complicated and, what's more, may not guarantee success in every instance.

    Regards
    Click * below if this answer helped

    Advanced Excel Techniques: http://excelxor.com/

  3. #3
    Registered User
    Join Date
    08-16-2011
    Location
    australia
    MS-Off Ver
    Excel 2013
    Posts
    40

    Re: lookup a range of data then sum totals on another sheet in order

    XOR,
    Thanks for your reply, the differences in the names was an oversight on my part, sorry.
    If I correct it will there be a way to make it possible?

  4. #4
    Registered User
    Join Date
    08-16-2011
    Location
    australia
    MS-Off Ver
    Excel 2013
    Posts
    40

    Re: lookup a range of data then sum totals on another sheet in order

    I have rectified the excel file
    Attached Files Attached Files

  5. #5
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: lookup a range of data then sum totals on another sheet in order

    Thanks.

    The best way to do this is to first set up some Named Ranges for each of the Categories, such as:

    Name: DEPOT
    Refers to: =Sheet2!$E$2:$E$29


    Name: WOOLWORTHS
    Refers to: =Sheet2!$G$2:$G$77


    etc.

    making sure that the Name you give each range matches precisely that in the range Sheet2!A2:A6 (I suggest, since Excel will not accept Defined Names which include spaces, that you define the NORTHERN TERRITORY name as NORTHERN_TERRITORY and amend the entry in cell A6 to this as well).

    Once you've done this, your formula in B2 becomes:

    =SUMPRODUCT(SUMIF(Sheet1!$A$2:$A$3493,INDIRECT(Sheet2!A2),Sheet1!$B$2:$B$3493))

    Copy down as required.

    Regards
    Last edited by XOR LX; 01-22-2014 at 11:00 AM.

  6. #6
    Registered User
    Join Date
    08-16-2011
    Location
    australia
    MS-Off Ver
    Excel 2013
    Posts
    40

    Re: lookup a range of data then sum totals on another sheet in order

    Hi XOR,

    Thanks for your reply, the info you gave me works great. I have cleaned up the workbook making sure every name matches.

    An issue Im having now is the workbook is slow to respond to typing and entering.
    I have looked on the net for similar issues but not had any luck.
    Any ideas???

    Thanks for your help
    Michael

  7. #7
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: lookup a range of data then sum totals on another sheet in order

    Hmmm,

    How many rows' worth of data are in there? Are there any macros running? Any Conditional Formatting extending to unnecessary rows?

    There are many possible explanations to your issue, though without seeing the actual file I couldn't be sure.

    Regards

  8. #8
    Registered User
    Join Date
    08-16-2011
    Location
    australia
    MS-Off Ver
    Excel 2013
    Posts
    40
    The amount of data the formula from you reads upto 4000 lines. I have very minimal formulas, no formatting , no macros. If you are happy to look at the file I can post it when I'm home.

    Appreciate your time
    Thanks

  9. #9
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: lookup a range of data then sum totals on another sheet in order

    Ok, sure. I'd be happy to take a look.

    Perhaps make sure any confidential/sensitive information is replaced with dummy data if you feel it necessary.

    Regards

  10. #10
    Registered User
    Join Date
    08-16-2011
    Location
    australia
    MS-Off Ver
    Excel 2013
    Posts
    40

    Re: lookup a range of data then sum totals on another sheet in order

    Hi XOR,

    I have attached the file. There isn't much in there that I would need to enter dummy cells, just a report for work.

    Just to recap on what the sheets are about:

    copy and paste tab,
    I copy data from another workbook, which on average uses about 4000 rows.

    Data tab,
    This is where you helped me with the formulas to read the previous tab.

    Variance tab,
    reporting spreadsheet that only uses simple sums and references to the data tab.

    Thank you for having a look at it for me.

    Michael
    Attached Files Attached Files

  11. #11
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: lookup a range of data then sum totals on another sheet in order

    Great. Thanks.

    And can you give me an example of what these performance issues are in this workbook and where/when they occur? I've typed in a few random cells, with no adverse effects/slowing down. I've manually recalculated the sheet in a fraction of a second.

    Do these issues you're having occur even when this workbook is the only one you have open in Excel? And you've tested on a different PC to rule that out as being the issue?

    Regards

  12. #12
    Registered User
    Join Date
    08-16-2011
    Location
    australia
    MS-Off Ver
    Excel 2013
    Posts
    40

    Re: lookup a range of data then sum totals on another sheet in order

    Hi,
    I have tried the file on 2 pc's with the same result. It happens when its the only workbook open, and also affects another workbook if open at the same time.
    I manually enter numbers into the variances tab in the gain and loss columns more than anywhere else, where slowing down is more noticeable, but it seems the whole workbook is affected
    in some way. I normally enter a number then enter for the next cell, and sometimes the waiting icon next to cursor appears. The gain and loss columns get deleted of the data entered previously the next day to start a new report, which then selecting cells with data in them is slow.

  13. #13
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: lookup a range of data then sum totals on another sheet in order

    Well I've had a good luck and am personally experiencing no issues related to speed/performace whatsoever, nor can I see what is in this file that could be causing such issues.

    This version that you attached is precisely the one with which you are experiencing these issues? You didn't amend a single thing prior to posting it?

    If it is the very same, then I can't see why I too wouldn't have the same difficulties, and so my conclusion would be that it must be something to do with your set-up, and not this workbook itself.

    Regards

  14. #14
    Registered User
    Join Date
    08-16-2011
    Location
    australia
    MS-Off Ver
    Excel 2013
    Posts
    40

    Re: lookup a range of data then sum totals on another sheet in order

    Hi,

    Thanks for your help, Yes it was the same workbook with no changes.
    It still does it on my pc, but I found if all the rows of data in the 'data' tab (which is copy and pasted from another workbook) is deleted the workbook isn't slow.
    Obviously now its all the data that the formula needs to read is slowing it down??

    Thanks
    Michael

  15. #15
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: lookup a range of data then sum totals on another sheet in order

    When you paste the data in, do you paste as values only?

    If not, you could be unknowingly pasting in formulas, links, formatting, Named Ranges, etc., etc. from the source workbook.

    Regards

  16. #16
    Registered User
    Join Date
    08-16-2011
    Location
    australia
    MS-Off Ver
    Excel 2013
    Posts
    40

    Re: lookup a range of data then sum totals on another sheet in order

    I normally just copy and paste, I didn't really give 'paste values only' a thought.
    The data from the other workbook is filtered, but very possible that it has other formulas, links, formatting etc.
    Thanks for the tip, I'll give it a try.


    Thanks once again I appreciate your help.
    Michael

  17. #17
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: lookup a range of data then sum totals on another sheet in order

    You're welcome.

+ 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. Replies: 5
    Last Post: 07-10-2013, 02:33 PM
  2. Lookup/Query Data from one Sheet/Range to another...Need Help
    By djtech2k in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 08-17-2012, 03:29 PM
  3. Macro to copy data from one sheet to a master sheet with running totals
    By gmi in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-14-2012, 10:53 AM
  4. Replies: 9
    Last Post: 04-04-2011, 12:03 AM
  5. Need Activate Sheet first in order to define range ?
    By cladelpino in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-03-2011, 01:27 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