Double conditional in a SUMIF function

1. Double conditional in a SUMIF function

I need some help. I'm try to cross analyse the national Covid-19 data base.

I'm reasonably familiar with the SUMIF function with a single conditional like
SUMIF(A:A, D3, H:H)

I use it for the bulk of my analysis.

I can't figure out the syntax to put a double conditional inside a SUMIF.

So here is the example I'm struggling with.

As a hypothetical example, say my spread sheet looks like this:
Column A has the date for the data in that row.
Column B has the two letter code for the state (e.g., NY) that the row contains.

I have the date of interest (e.g., 20200403) stored in cell D1.
I have the date of interest (e.g., NY) stored in cell E1.

The data sets contains many dates and many states, but for each state and date combination, there is only one row.

So, say I want to return the data in Column H, that is for the date in D1 and the state in E1.

I'm guessing that if I were better at EXCEL, I could find it with a LOOKUP function, but frankly every time I try I screw up.

Since the date/state combination are unique, then I could find the data for the following function which I can write in prose, but can't find the correct syntax for in a SUMIF; if it's possible.

That prose statement is:
SUM the data in Column H if the cell in Column A equals the cell D1 AND the cell in Row B equals the cell E1.

Since the date/state combinations are unique, that function should yield just the one result in Column H that I am looking for.

Can anyone help?

metsci

2. Re: Double conditional in a SUMIF function

it sounds like you want a SUMIFS instead. The general formula for a SUMIFS is =SUMIFS(area or column to be summed, condition one range, condition one, condition two range, condition two, etc.)
if you use dates you will need to include either "="&date or ">="&date or "<="&date for less than or equal to a date.
for more help you can upload a sample workbook with sample data AND expected results, follow the instructions in the yellow banner at the top of the post.

3. Re: Double conditional in a SUMIF function

Sambo Kid,

Thank you. Thank you. Thank you. Thank you. Thank you. Thank you. Thank you. Thank you. Thank you. Thank you. Thank you. Thank you.

Works perfectly. Solution is short and sweet.

Two asides:
1. I really appreciate the help. I am deeply involved trying to alert people to what I believe is a hole in their Covid-19 data analysis, and I didn't have time to rummage around for a solution.
2. The data base I download lists the dates as text; literally like "20200404", so I was able to proceed without the hint you gave in your last paragraph. I will save your last paragraph for when I have to analyse a data base with more conventional dates.

Can you teach me how to mark the thread as "Solved"?

I'm off to continues to work the database.

metsci

4. Re: Double conditional in a SUMIF function

Glad I could help. To mark as solved you use the thread tools dropdown at the top of this post. Good luck.

There are currently 1 users browsing this thread. (0 members and 1 guests)