+ Reply to Thread
Results 1 to 8 of 8

sum range of numbers if two criterias are met.

  1. #1
    Registered User
    Join Date
    08-07-2008
    Location
    Liverpool, UK
    Posts
    24

    sum range of numbers if two criterias are met.

    Hello all,

    Basically,

    I want to add a range of numbers in column AB

    Cell range in AB

    Year 1 = 04 to 364
    Year 2 = 365 to 1035
    Year 3 = 1036 to 1662
    Year 4 = 1663 to 2500

    if

    'unemployed' is in column AD

    and

    '500' is in AX:BI

    any ideas?

    once again, much appreciated

  2. #2
    Forum Expert
    Join Date
    06-18-2004
    Location
    Canada
    MS-Off Ver
    Office 2016
    Posts
    1,474
    Somewhat unclear... Can you post a small sample of the data (about 5 rows), along with the expected result?

  3. #3
    Registered User
    Join Date
    08-07-2008
    Location
    Liverpool, UK
    Posts
    24
    Please find attached:

    Outcome:
    so there is 1 match of 'unemployed' and '500' with 120 months so the sum would be 120.

    Anything else please do let me know.

    thanks again.
    Attached Files Attached Files

  4. #4
    Forum Expert
    Join Date
    06-18-2004
    Location
    Canada
    MS-Off Ver
    Office 2016
    Posts
    1,474
    Try...

    =SUMPRODUCT(--($B$4:$B$8="Unemployed"),--($J$4:$J$8=500),$A$4:$A$8)

    Although, from your original post, it looks like you're probably looking for something like this...

    =SUM(IF(MMULT(IF(B4:B8="Unemployed",IF(C3:N3="Committed",IF(C4:N8=500,1,0),0),0),TRANSPOSE(COLUMN(C3:N3)^0)),A4:A8))

    ...confirmed with CONTROL+SHIFT+ENTER.

    Hope this helps!

  5. #5
    Registered User
    Join Date
    08-07-2008
    Location
    Liverpool, UK
    Posts
    24

    Value error

    Hello Again,

    this formula

    =SUMPRODUCT(--($B$4:$B$8="Unemployed"),--($J$4:$J$8=500),$A$4:$A$8)

    This works witht the worksheet provided, however...

    comes up with a value error when tweaked to suit the worksheet (Tracking System):

    SUMPRODUCT('Tracking System'!$B$4:$AD$364="Unemployed"),('Tracking System'!$AX$4:$BI$364=500),'Tracking System'!$A$4:$A$364)

    the changes from your formula to mine is:

    B to AD
    J to AX:BI
    A to AB

    The range of year one is 4 to 364.

    I have tried the formula also (--( with no avail.

    Thanks again.

  6. #6
    Forum Contributor
    Join Date
    05-21-2004
    Location
    UK
    Posts
    136
    You have to have the same range sizes, you have more columns in the first condition than in the second, and when you use multiple columns, use (cond)*(cond)*(numbers) in the SP syntax.

  7. #7
    Forum Expert
    Join Date
    06-18-2004
    Location
    Canada
    MS-Off Ver
    Office 2016
    Posts
    1,474
    To sum Column A, where any of the corresponding values in Columns B through AD equals "Unemployed" and any of the corresponding values in Columns AX through BI equals 500, try...

    Confirmed with CONTROL+SHIFT+ENTER:

    =SUM(IF(MMULT((B4:AD364="Unemployed")+0,TRANSPOSE(COLUMN(B4:AD364)^0)),IF(MMULT((AX4:BI364=500)+0,TRANSPOSE(COLUMN(AX4:BI364)^0)),A4:A364)))

    Confirmed with just ENTER:

    =SUMPRODUCT(--(MMULT((B4:AD364="Unemployed")+0,ROW(B4:INDEX(B4:B364,COLUMNS(B4:AD364)))^0)>0),--(MMULT((AX4:BI364=500)+0,ROW(AX4:INDEX(AX4:AX364,COLUMNS(AX4:BI364)))^0)>0),A4:A364)

    Hope this helps!

  8. #8
    Registered User
    Join Date
    08-07-2008
    Location
    Liverpool, UK
    Posts
    24

    Sorted

    Thanks again, worked out like this....

    =SUM(IF(MMULT(('Tracking System'!AD4:AD364="Unemployed")+0,TRANSPOSE(COLUMN('Tracking System'!AD4:AD364)^0)),IF(MMULT(('Tracking System'!AX4:BI364=500)+0,TRANSPOSE(COLUMN('Tracking System'!AX4:BI364)^0)),'Tracking System'!AB4:AB364)))

+ 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. Using Excel to help select Lotto numbers.....
    By farmerTom in forum Excel - New Users/Basics
    Replies: 6
    Last Post: 10-15-2018, 05:09 AM
  2. How to make AVERAGE() return "-" if there are no numbers in a range
    By cogar in forum Excel Programming / VBA / Macros
    Replies: 20
    Last Post: 07-28-2008, 01:50 PM
  3. Calculate Average of Range That is Not All Numbers
    By mwgr5 in forum Excel General
    Replies: 4
    Last Post: 07-11-2008, 10:16 AM
  4. IF function for a range of numbers within another range
    By deafmetal in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 01-27-2008, 08:18 AM
  5. Setting a range of numbers
    By estebanrey in forum Excel General
    Replies: 1
    Last Post: 06-30-2007, 10:01 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