Share via

Need help with SUMIF statement

Anonymous
2024-08-15T14:07:23+00:00

I’ve been working on a formula for an Excel spreadsheet for several months. What I’d like the formula to do is add up all the Critical’s, High’s, Medium’s, and Low’s on the STATS-HOST-SEVERITY tab and put the totals on the SCORECARD tab in their respective fields (put the total of Critical’s from the STATS-HOST-SEVERITY tab, in the cell to the right of Critical on the SCORECARD tab, the total of High’s on STATS-HOST-SEVERITY to the right of High’s on the SCORECARD tab, & so on).

However, sometimes one or more of the Critical’s, High’s, Medium’s and Low’s don’t always show up on the report. So I need the formula to look to see if this field is present. If it is, then SUM / count how many there are of that particular category and put that total on the SCORECARD. And if there isn’t any, then put a zero in that category.

These are a couple formulas I’ve tried that I thought for sure would work. But they’re still not giving me the correct answer.

=SUMIF('STATS-HOST-SEVERITY'!B2:E2,"High",'STATS-HOST-SEVERITY'!C3:C33)

=SUMIF('STATS-HOST-SEVERITY'!B2:E2,SCORECARD!A5,'STATS-HOST-SEVERITY'!B:F)

Microsoft 365 and Office | Excel | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments
Answer accepted by question author
  1. Anonymous
    2024-08-15T14:29:15+00:00

    Replace your 1st formula with this one
    =SUMPRODUCT(('STATS-HOST-SEVERITY'!B2:E2="High")*('STATS-HOST-SEVERITY'!B3:E33))

    Replace your 2nd formula with this one
    =SUMPRODUCT(('STATS-HOST-SEVERITY'!B2:E2=ScoreCard!A5)*('STATS-HOST-SEVERITY'!B3:E33))

    Hope it helps..

    1 person found this answer helpful.
    0 comments No comments

4 additional answers

Sort by: Most helpful
  1. Ashish Mathur 101.8K Reputation points Volunteer Moderator
    2024-08-16T23:26:46+00:00

    You are welcome. Try this

    =SUM(drop(XLOOKUP(A5,'STATS-HOST-SEVERITY'!$B$2:$E$2,'STATS-HOST-SEVERITY'!B3:E33),-1))

    0 comments No comments
  2. Anonymous
    2024-08-16T12:01:40+00:00

    Thank you so much for your help with the formula. Your formula worked great. On the "STATS-HOST-SEVERITY" page, I have a "Grand Total" row. Since my report doesn't always have the same amount of rows each time I run it and I don't want to add that into the total. How can I make sure Excel doesn't include that row when it runs the formula? Do I need to add something like:

    -('STATS-HOST-SEVERITY'!'Grand Total')

    I did try it, but it didn't work.

    0 comments No comments
  3. Ashish Mathur 101.8K Reputation points Volunteer Moderator
    2024-08-15T23:14:52+00:00

    Hi,

    In cell B5 of the Score card worksheet, enter this formula

    =SUM(XLOOKUP(A5,'STATS-HOST-SEVERITY'!$B$2:$E$2,'STATS-HOST-SEVERITY'!B3:E33))

    Hope this helps.

    0 comments No comments
  4. Anonymous
    2024-08-15T19:08:27+00:00

    Thank you both of those worked. I really appreciate your help.

    0 comments No comments