+ Reply to Thread
Results 1 to 5 of 5

Sum values if criteria is spread across two columns

  1. #1
    Registered User
    Join Date
    04-29-2019
    Location
    Katowice
    MS-Off Ver
    2013
    Posts
    23

    Sum values if criteria is spread across two columns

    Hey,

    I have a simple table (list) of 3 columns. Two of them represent different units (let's say different company names) that repeat irregularilly within both columns. The other column lists number of transactions assigned the the unit.
    I am trying to write a formula where I'd sum up values within a single column provided that the value "belongs" to a given unit. See example below

    Name 1 | Name 2 | Number to be summed up
    x | a | 1
    y | b | 4
    z | x | 7

    I'd like the formula to sum values for Name "X". In this case it would be 8.

    Hope my explanation is clear, I'd appreciate any indication how to do it. I've tried with SUMIF but most likely it needs to be more complex than that.

    Thanks!
    Charles

  2. #2
    Forum Expert PaulM100's Avatar
    Join Date
    10-09-2017
    Location
    UK
    MS-Off Ver
    Office 365
    Posts
    2,108

    Re: Sum values if criteria is spread across two columns

    This should work: =SUMPRODUCT(($C$6:$D$8="x")*($E$6:$E$8))
    Click the * to say thanks.

  3. #3
    Registered User
    Join Date
    04-29-2019
    Location
    Katowice
    MS-Off Ver
    2013
    Posts
    23

    Re: Sum values if criteria is spread across two columns

    Thanks for quick reply Paul. Tried it but doesn't work for me.

    How I understand it:
    ($C$6:$D$8="x") -> the array with the name of the company
    ($E$6:$E$8) -> the column with values

    Why would you multiply it ? just a thought.

    Thanks!

  4. #4
    Registered User
    Join Date
    04-29-2019
    Location
    Katowice
    MS-Off Ver
    2013
    Posts
    23

    Re: Sum values if criteria is spread across two columns

    Worked eventually ! Thank you.

  5. #5
    Forum Expert PaulM100's Avatar
    Join Date
    10-09-2017
    Location
    UK
    MS-Off Ver
    Office 365
    Posts
    2,108

    Re: Sum values if criteria is spread across two columns

    ($C$6:$D$8="x")*($E$6:$E$8))
    $C$6:$D$8 - columns of companies
    $E$6:$E$8 - column to sum
    X - the company you are looking for
    ($C$6:$D$8="x") - this will return an array of true and false
    doing the multiplication will coerce the true and false to 1 and 0, and will multiply the result with the values returned from summing column(Eg in this case(1*1+1*7)

+ 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. Sorting a list/values that are spread out over multiple columns
    By HandsomePrints in forum Excel General
    Replies: 13
    Last Post: 11-04-2018, 12:09 AM
  2. Pull values from Multiple columns that are spread apart
    By Dodie9 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 04-16-2015, 06:24 AM
  3. How to group values spread across columns in Pivot
    By Excelreserve in forum Excel Charting & Pivots
    Replies: 2
    Last Post: 02-12-2015, 03:46 PM
  4. Replies: 1
    Last Post: 04-28-2014, 06:47 AM
  5. [SOLVED] Copy/Paste multiple columns as values based on another columns criteria
    By Dgp2012 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 07-28-2013, 06:50 AM
  6. Replies: 0
    Last Post: 10-02-2012, 09:09 AM
  7. Replies: 2
    Last Post: 10-05-2011, 12:43 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