ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Summing types with one formula (https://www.excelbanter.com/excel-discussion-misc-queries/35349-summing-types-one-formula.html)

citizens1stbank

Summing types with one formula
 

I am having difficulty writing a formula to sum two different types of
data in single formula. I know how to use an "if" statement to create
another two columns and add this way, but I would like to use a
vlookup, maybe?, or something to total. Below is a simplified version
of what I am trying to get two different sums for. I need a total of
"DIV"s and a total of "AP"s as well. Thank you for any assistance.

Type Amount
AP $1,050,100
AP $249,500
AP $99,200
DIV $18,700
AP $129,000
AP $150,000
AP $300,000
AP $198,800
DIV $28,100


--
citizens1stbank
------------------------------------------------------------------------
citizens1stbank's Profile: http://www.excelforum.com/member.php...o&userid=25237
View this thread: http://www.excelforum.com/showthread...hreadid=387261


bj

try
=countif(A1:A100,"DIV",B1:B100)

"citizens1stbank" wrote:


I am having difficulty writing a formula to sum two different types of
data in single formula. I know how to use an "if" statement to create
another two columns and add this way, but I would like to use a
vlookup, maybe?, or something to total. Below is a simplified version
of what I am trying to get two different sums for. I need a total of
"DIV"s and a total of "AP"s as well. Thank you for any assistance.

Type Amount
AP $1,050,100
AP $249,500
AP $99,200
DIV $18,700
AP $129,000
AP $150,000
AP $300,000
AP $198,800
DIV $28,100


--
citizens1stbank
------------------------------------------------------------------------
citizens1stbank's Profile: http://www.excelforum.com/member.php...o&userid=25237
View this thread: http://www.excelforum.com/showthread...hreadid=387261



Dave O

If your TYPE column is A and the AMOUNT column is B, they'll occupy
rows 1 - 10 (including header). In A12 enter AP and in A13 enter DIV.
In B12 try this formula:
=SUMIF($A$2:$A$10,A12,$B$2:$B$10)
.... and copy it into B13.

If I can suggest, incorporate a checksum into the new totals to make
sure they match the sum of B2:B10. This will alert you to anomalies.


citizens1stbank


I knew that function, it had just been too long. Thanks a lot. The SUMIF
worked great. COUNTIF didn't, however.


--
citizens1stbank
------------------------------------------------------------------------
citizens1stbank's Profile: http://www.excelforum.com/member.php...o&userid=25237
View this thread: http://www.excelforum.com/showthread...hreadid=387261



All times are GMT +1. The time now is 02:38 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com