# Sum of a column (w/out duplicates) based on 3 conditions

#### Estimator_J

##### New Member
Hello,

I have one column where the "State" is listed.
Another column states "Public" or "Private".
I would like to sum the "Amount" column for each state based on public or private.
However, there are duplicates in the amount column so I need the result to not include duplicates.

I have another formula for figuring out the amount based on state only but I would like to take it a step further and add another condition, public or private. Does anyone have an idea of how to structure the formula for the third condition?

Thank you!

### Excel Facts

Back into an answer in Excel
Use Data, What-If Analysis, Goal Seek to find the correct input cell value to reach a desired result

#### jorismoerings

##### Well-known Member
Hi,

Take a look at this and see if this will help:

Book1
ABCDE
1statestatusamountFlorida
2FloridaPublic100Public
3FloridaPrivate200201
4TexasPublic100
5TexasPrivate200
6FloridaPublic101
7FloridaPrivate200
8TexasPublic102
9TexasPrivate200
Sheet1
Cell Formulas
RangeFormula
E3{=SUM(IF(FREQUENCY(IF(A2:A9=E1,IF(\$B\$2:\$B\$9=E2,IF(\$C\$2:\$C\$9<>"",MATCH(\$C\$2:\$C\$9,\$C\$2:\$C\$9,0)))),ROW(\$B\$2:\$B\$9)-ROW(\$B\$2)+1),\$C\$2:\$C\$9))}
Press CTRL+SHIFT+ENTER to enter array formulas.

#### Estimator_J

##### New Member
It worked beautifully! Thank you!
Hi,

Take a look at this and see if this will help:

ABCDE
1statestatusamountFlorida
2FloridaPublic100Public
3FloridaPrivate200201
4TexasPublic100
5TexasPrivate200
6FloridaPublic101
7FloridaPrivate200
8TexasPublic102
9TexasPrivate200

</tbody>
Sheet1

Array Formulas
CellFormula
E3{=SUM(IF(FREQUENCY(IF(A2:A9=E1,IF(\$B\$2:\$B\$9=E2,IF(\$C\$2:\$C\$9<>"",MATCH(\$C\$2:\$C\$9,\$C\$2:\$C\$9,0)))),ROW(\$B\$2:\$B\$9)-ROW(\$B\$2)+1),\$C\$2:\$C\$9))}

</tbody>
Entered with Ctrl+Shift+Enter. If entered correctly, Excel will surround with curly braces {}.
Note: Do not try and enter the {} manually yourself

<tbody>
</tbody>

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

1,164,486
Messages
5,837,614
Members
430,506
Latest member
TonyIbbs

### 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.

### Which adblocker are you using?

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

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