Help with CountIfs statement regarding a table

JenniferMurphy

Well-known Member
Joined
Jul 23, 2011
Messages
2,691
Office Version
  1. 365
Platform
  1. Windows
I would like to a formula for 3 sums:
  1. Votes where Biden has the greater projected vote share
  2. Votes where Trump has the greater projected vote share
  3. Votes where the percentages are equal.
The table on the right has the correct totals. It shows which cells should go it each category. But I would like an expression that will work for the whole table. The one below is just a few rows.

This gets a zero: =SUMIFS(Table25[Electoral Votes],Table25[Projected Vote Share Biden],F9>G9)

This gets a #VALUE error: =SUMIFS(Table25[Electoral Votes],Table25[[Projected Vote Share Biden]:[Projected Vote Share Trump]],F9>G9)

2024 Presidential Election Polling.xlsx
CDEFGHIJKL
8StateElectoral VotesCurrent LeaderProjected Vote Share BidenProjected Vote Share TrumpElectoral Votes BidenElectoral Votes Trump
9Alabama9Trump35%64%09Sum
10Alaska3Trump41%55%03Biden89
11Arizona11Toss-up49%48%5.55.5Trump18
12Arkansas6Trump35%64%06Tie46
13California54Biden62%36%540
14Colorado10Biden57%41%100
15Connecticut7Biden60%38%70
16Delaware3Biden62%36%30
17Florida30Toss-up49%49%1515
18Georgia16Toss-up49%49%88
19Hawaii4Biden66%33%40
Sheet2
Cell Formulas
RangeFormula
H9:H19H9=IF([@[Current Leader]]="Biden",[@[Electoral Votes]],IF([@[Current Leader]]="Toss-up",[@[Electoral Votes]]/2,0))
I9:I19I9=IF([@[Current Leader]]="Trump",[@[Electoral Votes]],IF([@[Current Leader]]="Toss-up",[@[Electoral Votes]]/2,0))
L10L10=D11+D13+D14+D15+D16+D19
L11L11=D9+D10+D12
L12L12=D17+D18
 

Excel Facts

Format cells as time
Select range and press Ctrl+Shift+2 to format cells as time. (Shift 2 is the @ sign).
You could use sumproduct:

Excel Formula:
=SUMPRODUCT(Table25[Electoral Votes],--(Table25[Projected Vote Share Biden]>Table25[Projected Vote Share Trump]))
 
Upvote 0
Solution
You could use sumproduct:

Excel Formula:
=SUMPRODUCT(Table25[Electoral Votes],--(Table25[Projected Vote Share Biden]>Table25[Projected Vote Share Trump]))
That works, thanks. If there to way to use SumIfs?
 
Upvote 0
Not without helper columns because the criteria you are passing are True/False values, and none of your columns contain True/False.
 
Upvote 0

Forum statistics

Threads
1,224,813
Messages
6,181,111
Members
453,021
Latest member
Justyna P

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