+ Reply to Thread
Results 1 to 2 of 2

SUM array with multiple columns

  1. #1
    Forum Contributor
    Join Date
    08-14-2006
    Location
    USA
    MS-Off Ver
    2019
    Posts
    686

    SUM array with multiple columns

    Data is all in the same workbook

    Sheet ‘Cost Calc’ contains adjacent columns of (fitting) part numbers and their quantity. The part number appears multiple times in some but not all columns.
    Part Number columns:
    AK AO AS AW BA BI
    Quantity columns:
    AL AP AT AX BB BJ

    Sheet ‘Fittings’ contains a comprehensive list of fittings in column A
    This array formula in B2 works to total the quantity of parts in AK and their quantity in AL that match the part number in A2
    =SUM(('COST CALC'!AK$8:AK$376=A2)*('COST CALC'!AL$8:AL$376))

    What I want to do is total the quantity in all 6 part number columns,
    I can get the answer I want with the following:
    =SUM(('COST CALC'!AK$8:AK$376=A2)*('COST CALC'!AL$8:AL$376) + ('COST CALC'!AO$8:AO$376=A2)*('COST CALC'!AP$8:AP$376)) + etc. etc. etc. for the remaining columns )
    But is there a way to do an array that looks at all the part number columns and their adjacent quantity and totals them up without spelling out all 6 pairs of columns as above?

    Note there are non related columns in between the pairs of part numbers & quantity columns.


    PS. when I enter this SUM formula by clicking on the cost calc sheet cells (rather than typing the entire formula) it defaults to the fittings sheet name and I have to manually erase fittings! and type ‘cost calc’!
    Why is this?

  2. #2
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,483

    Cool

    if your formula works you could just name it, then all you would have to enter is

    =MyNamedFormula

    goto Insert,Name,Define

    Enter a OneWordName

    in the reference box type in formula

    =SUM(('COST CALC'!AK$8:AK$376=A2)*('COST CALC'!AL$8:AL$376))

    or even this

    =SUM(('COST CALC'!AK$8:AK$376=A2)*('COST CALC'!AL$8:AL$376) + ('COST CALC'!AO$8:AO$376=A2)*('COST CALC'!AP$8:AP$376))

    once you have a named formula in the cell just enter

    = MyNamedFormula

    you can even say

    =MyNamedFormula+MyOtherFormula

    whatever you need

    Unfortunatly you can't paste into the reference box (at least not in my version of xl) so you will have to rewrite the formula(s), but it saves time in the long run

+ 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