+ Reply to Thread
Results 1 to 5 of 5

Formula for multiple matches to sum result from another column into another sheet

  1. #1
    Registered User
    Join Date
    05-04-2013
    Location
    Melbourne Australia
    MS-Off Ver
    Excel 2007
    Posts
    24

    Question Formula for multiple matches to sum result from another column into another sheet

    I have spent so much time trying to figure this out on my own with a spectacular lack of success

    I want to lookup a number of codes and then sum the balances from another column if code matches are found. There are 12 codes that I want to combine into one cell on another sheet in the same workbook. The data is exported from another program and I want to avoid having to manipulate that in any way but would just like to paste in into excel and have excel do all the work. Each month I need to compare results for the same period last year so I need this formula to work on freshly pasted data. The same number of accounts may not have a balance in column C each month but when any of the 12 account codes do appear I need the formula to identify if the code is there and then sum the number in col c into cell G7 on Jul 13 sheet. Each month I will have a new sheet in the same workbook for current month and LY month. The 12 old codes need to be combined for the new code 6-2440 shown on consolidation of gl codes sheet.

    The uploaded example is a snapshot of part of the file and the columns that are blank are populated in the real file so need to be left alone.

    Jul 13 cell G8 should show total $53,161.87 which is the combined total of the following codes found on LY July Data sheet
    6-2231 $9,803.70
    6-2232 $3,650.08
    6-2233 $25,769.22
    6-2234 $17,307.70
    6-2235 $2,769.24
    6-2273 $1,237.50
    6-2599 ($7,375.57)

    I created a formula that got ridiculously long when I had to combine 6 codes in another section of the spreadsheet and I am sure that there are much better ways to achieve the same result but to my utter amazement it does work! Formula is shown below, please be kind and don't laugh too loud Clearly as you can see I am in need of some expert help!

    =SUMPRODUCT(IF(ISNA(VLOOKUP($A78,'LY Jul Data'!$A:$F,3,0)),0,VLOOKUP($A78,'LY Jul Data'!$A:$F,3,0)))+(IF(ISNA(VLOOKUP('Consolidation of gl codes'!A49,'LY Jul Data'!A:F,3,0)),0,VLOOKUP('Consolidation of gl codes'!A49,'LY Jul Data'!A:F,3,0))+(IF(ISNA(VLOOKUP('Consolidation of gl codes'!A50,'LY Jul Data'!A:F,3,0)),0,VLOOKUP('Consolidation of gl codes'!A50,'LY Jul Data'!A:F,3,0))+(IF(ISNA(VLOOKUP('Consolidation of gl codes'!A51,'LY Jul Data'!A:F,3,0)),0,VLOOKUP('Consolidation of gl codes'!A51,'LY Jul Data'!A:F,3,0))+(IF(ISNA(VLOOKUP('Consolidation of gl codes'!A52,'LY Jul Data'!A:F,3,0)),0,VLOOKUP('Consolidation of gl codes'!A52,'LY Jul Data'!A:F,3,0))+(IF(ISNA(VLOOKUP('Consolidation of gl codes'!A116,'LY Jul Data'!A:F,3,0)),0,VLOOKUP('Consolidation of gl codes'!A116,'LY Jul Data'!A:F,3,0)))))))

    Note the formula must work in Excel 2003 please.

    Hoping someone can save my sanity
    Attached Files Attached Files

  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: Formula for multiple matches to sum result from another column into another sheet

    G'day,

    From what I can see a helper column is in order. See attachment.
    Attached Files Attached Files
    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
    05-04-2013
    Location
    Melbourne Australia
    MS-Off Ver
    Excel 2007
    Posts
    24

    Re: Formula for multiple matches to sum result from another column into another sheet

    g'day ratcat

    Thanks so much for your assistance, much appreciated! Please see the attached as there is something not quite right with the formula as it is returning the figure in the row below and I'm not sure why? (see sheet attached as I have added column that shows the correct result). Also would it be possible to have the formulas in col H on sheet LY Jul Data in the Consolidation of gl codes sheet instead as that one remains unchanged each month whereas there will be a new LY sheet each month?

    Many thanks
    Attached Files Attached Files

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

    Re: Formula for multiple matches to sum result from another column into another sheet

    Sorry it was a typo that upset the right value being displayed with the right code.

    Wrong

    =SUMIF('LY Jul Data'!$H$10:$H$32,'JUL 13'!A6,'LY Jul Data'!$C$11:$C$31)

    It should be this

    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    05-04-2013
    Location
    Melbourne Australia
    MS-Off Ver
    Excel 2007
    Posts
    24

    Re: Formula for multiple matches to sum result from another column into another sheet

    Thanks ratcat, this works perfectly! I see now why it wasn't returning the correct result. I have copied this into my spreadsheet for the first 3 months of the year and it works just perfectly This will be such a time saver so thank you sooooooo much

    PS I did reply earlier before closing the thread but somehow that reply didn't get posted

+ 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: 11
    Last Post: 10-11-2013, 08:02 AM
  2. Replies: 10
    Last Post: 08-19-2013, 11:33 AM
  3. [SOLVED] INDEX MATCH array formula that matches substring n gives multiple matches
    By bkwins in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 04-12-2013, 04:57 AM
  4. Replies: 3
    Last Post: 02-13-2013, 04:05 PM
  5. Find the last-row result of multiple matches?
    By goodiein2808 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 07-08-2011, 11:53 AM

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