VLookUp - Sum - Different criterias

stevekho

New Member
Joined
May 5, 2011
Messages
29
Hello,

Here is my problem and I hope you will be able to help:

In have in my column A, 100 different States
In My column B, I have the Corresponding Counties
In Row 2, I have some dates (from 2008 Sep 1 until now)

Basically I want to sum all the values of August 17th for instance that are in State X [Column A] and in Counties Y [ Column B].

I want to be able to change the date and still get the values.

I tried SumIfS but couldnt get it :/

Thanks!!
 

Excel Facts

Bring active cell back into view
Start at A1 and select to A9999 while writing a formula, you can't see A1 anymore. Press Ctrl+Backspace to bring active cell into view.
Try like this

Date in E1

=SUMPRODUCT(--(A1:A100="TX"),--(B1:B100="County1"),--(C1:C100=$E$1),D1:D100)
 
Last edited:
Upvote 0
Nice

Do you think there is a way to put a range of date also? If I want just a monthly average for instance

Thanks!
 
Upvote 0
<br /><table cellpadding="2.5px" rules="all" style=";background-color: #FFFFFF;border: 1px solid;border-collapse: collapse; border-color: #A6AAB6"><colgroup><col width="25px" style="background-color: #E0E0F0" /><col /><col /><col /><col /><col /></colgroup><thead><tr style=" background-color: #E0E0F0;text-align: center;color: #161120"><th></th><th>A</th><th>B</th><th>C</th><th>D</th><th>E</th></tr></thead><tbody><tr ><td style="color: #161120;text-align: center;">2</td><td style="font-weight: bold;text-align: center;;">STATE</td><td style="font-weight: bold;text-align: center;;">COUNTY</td><td style="font-weight: bold;text-align: center;;">8/16/2011</td><td style="font-weight: bold;text-align: center;background-color: #CCFFFF;;">8/17/2011</td><td style="font-weight: bold;text-align: center;;">8/18/2011</td></tr><tr ><td style="color: #161120;text-align: center;">3</td><td style="text-align: center;;">FL</td><td style="text-align: center;;">ORANGE</td><td style="text-align: center;;">3</td><td style="text-align: center;;">4</td><td style="text-align: center;;">5</td></tr><tr ><td style="color: #161120;text-align: center;">4</td><td style="text-align: center;background-color: #CCFFCC;;">WI</td><td style="text-align: center;background-color: #99CCFF;;">DANE</td><td style="text-align: center;;">4</td><td style="text-align: center;background-color: #FFFF99;;">5</td><td style="text-align: center;;">6</td></tr><tr ><td style="color: #161120;text-align: center;">5</td><td style="text-align: center;background-color: #CCFFCC;;">WI</td><td style="text-align: center;;">PORTAGE</td><td style="text-align: center;;">5</td><td style="text-align: center;;">6</td><td style="text-align: center;;">7</td></tr><tr ><td style="color: #161120;text-align: center;">6</td><td style="text-align: center;background-color: #CCFFCC;;">WI</td><td style="text-align: center;background-color: #99CCFF;;">DANE</td><td style="text-align: center;;">6</td><td style="text-align: center;background-color: #FFFF99;;">7</td><td style="text-align: center;;">8</td></tr><tr ><td style="color: #161120;text-align: center;">7</td><td style="text-align: center;;">FL</td><td style="text-align: center;;">ORANGE</td><td style="text-align: center;;">7</td><td style="text-align: center;;">8</td><td style="text-align: center;;">9</td></tr><tr ><td style="color: #161120;text-align: center;">8</td><td style="text-align: center;;"></td><td style="text-align: center;;"></td><td style="text-align: center;;"></td><td style="text-align: center;;"></td><td style="text-align: center;;"></td></tr><tr ><td style="color: #161120;text-align: center;">9</td><td style="text-align: center;;"></td><td style="text-align: center;;"></td><td style="text-align: center;;"></td><td style="text-align: center;;"></td><td style="text-align: center;;"></td></tr><tr ><td style="color: #161120;text-align: center;">10</td><td style="font-weight: bold;text-align: center;;">STATE</td><td style="font-weight: bold;text-align: center;;">COUNTY</td><td style="font-weight: bold;text-align: center;;">DATE</td><td style="font-weight: bold;text-align: center;;">TOTAL</td><td style="font-weight: bold;text-align: center;;">AVG</td></tr><tr ><td style="color: #161120;text-align: center;">11</td><td style="text-align: center;background-color: #CCFFCC;;">WI</td><td style="text-align: center;background-color: #99CCFF;;">DANE</td><td style="text-align: center;background-color: #CCFFFF;;">8/17/2011</td><td style="text-align: center;background-color: #FFFF99;;">12</td><td style="text-align: center;background-color: #FFFF99;;">6</td></tr></tbody></table><br /><br /><table cellpadding="2.5px" rules="all" style=";border: 2px solid black;border-collapse:collapse;padding: 0.4em;background-color: #FFFFFF" ><tr><td style="padding:6px" ><b>Worksheet Formulas</b><table cellpadding="2.5px" width="100%" rules="all" style="border: 1px solid;text-align:center;background-color: #FFFFFF;border-collapse: collapse; border-color: #A6AAB6"><thead><tr style=" background-color: #E0E0F0;color: #161120"><th width="10px">Cell</th><th style="text-align:left;padding-left:5px;">Formula</th></tr></thead><tbody><tr><th width="10px" style=" background-color: #E0E0F0;color: #161120">D11</th><td style="text-align:left">=DSUM(<font color="Blue">A2:E7,MATCH(<font color="Red">C11,2:2,0</font>),A10:B11</font>)</td></tr><tr><th width="10px" style=" background-color: #E0E0F0;color: #161120">E11</th><td style="text-align:left">=DAVERAGE(<font color="Blue">A2:E7,MATCH(<font color="Red">C11,2:2,0</font>),A10:B11</font>)</td></tr></tbody></table></td></tr></table><br />
 
Upvote 0
Hello,

Here is my problem and I hope you will be able to help:

In have in my column A, 100 different States
In My column B, I have the Corresponding Counties
In Row 2, I have some dates (from 2008 Sep 1 until now)

Basically I want to sum all the values of August 17th for instance that are in State X [Column A] and in Counties Y [ Column B].

I want to be able to change the date and still get the values.

I tried SumIfS but couldnt get it :/

Thanks!!
Is this what you had in mind...

Data table:

Book1
ABCDEFG
1StateCounty1/1/20111/2/20111/3/20111/4/20111/5/2011
21A532874570
31A694438966
42B119094491
53C361560472
Sheet1

Criteria:

Book1
ABCDE
10StateCountyFromToTotal
111A1/2/20111/4/2011243
Sheet1

This formula entered in E11:

=SUMPRODUCT((A2:A5=A11)*(B2:B5=B11)*(C1:G1>=C11)*(C1:G1<=D11)*C2:G5)
 
Upvote 0
<br /><table cellpadding="2.5px" rules="all" style=";background-color: #FFFFFF;border: 1px solid;border-collapse: collapse; border-color: #A6AAB6"><colgroup><col width="25px" style="background-color: #E0E0F0" /><col /><col /><col /><col /><col /></colgroup><thead><tr style=" background-color: #E0E0F0;text-align: center;color: #161120"><th></th><th>A</th><th>B</th><th>C</th><th>D</th><th>E</th></tr></thead><tbody><tr ><td style="color: #161120;text-align: center;">2</td><td style="font-weight: bold;text-align: center;;">STATE</td><td style="font-weight: bold;text-align: center;;">COUNTY</td><td style="font-weight: bold;text-align: center;;">8/16/2011</td><td style="font-weight: bold;text-align: center;background-color: #CCFFFF;;">8/17/2011</td><td style="font-weight: bold;text-align: center;background-color: #CCFFFF;;">8/18/2011</td></tr><tr ><td style="color: #161120;text-align: center;">3</td><td style="text-align: center;;">FL</td><td style="text-align: center;;">ORANGE</td><td style="text-align: center;;">3</td><td style="text-align: center;;">4</td><td style="text-align: center;;">5</td></tr><tr ><td style="color: #161120;text-align: center;">4</td><td style="text-align: center;background-color: #CCFFCC;;">WI</td><td style="text-align: center;background-color: #99CCFF;;">DANE</td><td style="text-align: center;;">4</td><td style="text-align: center;background-color: #FFFF99;;">5</td><td style="text-align: center;background-color: #FFFF99;;">6</td></tr><tr ><td style="color: #161120;text-align: center;">5</td><td style="text-align: center;background-color: #CCFFCC;;">WI</td><td style="text-align: center;;">PORTAGE</td><td style="text-align: center;;">5</td><td style="text-align: center;;">6</td><td style="text-align: center;;">7</td></tr><tr ><td style="color: #161120;text-align: center;">6</td><td style="text-align: center;background-color: #CCFFCC;;">WI</td><td style="text-align: center;background-color: #99CCFF;;">DANE</td><td style="text-align: center;;">6</td><td style="text-align: center;background-color: #FFFF99;;">7</td><td style="text-align: center;background-color: #FFFF99;;">8</td></tr><tr ><td style="color: #161120;text-align: center;">7</td><td style="text-align: center;;">FL</td><td style="text-align: center;;">ORANGE</td><td style="text-align: center;;">7</td><td style="text-align: center;;">8</td><td style="text-align: center;;">9</td></tr><tr ><td style="color: #161120;text-align: center;">8</td><td style="text-align: center;;"></td><td style="text-align: center;;"></td><td style="text-align: center;;"></td><td style="text-align: center;;"></td><td style="text-align: center;;"></td></tr><tr ><td style="color: #161120;text-align: center;">9</td><td style="text-align: center;;"></td><td style="text-align: center;;"></td><td style="text-align: center;;"></td><td style="text-align: center;;"></td><td style="text-align: center;;"></td></tr><tr ><td style="color: #161120;text-align: center;">10</td><td style="font-weight: bold;text-align: center;;">STATE</td><td style="font-weight: bold;text-align: center;;">COUNTY</td><td style="font-weight: bold;text-align: center;;">DATE Start</td><td style="font-weight: bold;text-align: center;;">DATE End</td><td style="font-weight: bold;text-align: center;;">TOTAL</td></tr><tr ><td style="color: #161120;text-align: center;">11</td><td style="text-align: center;background-color: #CCFFCC;;">WI</td><td style="text-align: center;background-color: #99CCFF;;">DANE</td><td style="text-align: center;background-color: #CCFFFF;;">8/17/2011</td><td style="text-align: center;background-color: #CCFFFF;;">8/18/2011</td><td style="text-align: center;background-color: #FFFF99;;">26</td></tr></tbody></table><br /><br /><table cellpadding="2.5px" rules="all" style=";border: 2px solid black;border-collapse:collapse;padding: 0.4em;background-color: #FFFFFF" ><tr><td style="padding:6px" ><b>Worksheet Formulas</b><table cellpadding="2.5px" width="100%" rules="all" style="border: 1px solid;text-align:center;background-color: #FFFFFF;border-collapse: collapse; border-color: #A6AAB6"><thead><tr style=" background-color: #E0E0F0;color: #161120"><th width="10px">Cell</th><th style="text-align:left;padding-left:5px;">Formula</th></tr></thead><tbody><tr><th width="10px" style=" background-color: #E0E0F0;color: #161120">E11</th><td style="text-align:left">=SUMPRODUCT(<font color="Blue">(<font color="Red">A3:A7=A11</font>)*(<font color="Red">B3:B7=B11</font>)*(<font color="Red">C2:E2>=C11</font>)*(<font color="Red">C2:E2<=D11</font>)*C3:E7</font>)</td></tr></tbody></table></td></tr></table><br />
 
Upvote 0

Forum statistics

Threads
1,224,618
Messages
6,179,917
Members
452,949
Latest member
beartooth91

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top