ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   SUMIF and IF (https://www.excelbanter.com/excel-worksheet-functions/206564-sumif-if.html)

silversilver

SUMIF and IF
 
I have two columns, one of text and one of numbers.

I'm trying to get a sum of the cells in column A if column B has a
particular text.

For Instance:

1 AAA
2 BBB
1 CCC
3 AAA

I need a formula that counts the value of the cells in column A when column
B says AAA.

Any suggestions?

Sheeloo[_3_]

SUMIF and IF
 
Enter this in D1 with AAA or BBB in C1
=SUMPRODUCT(--(A1:A100),--(B1:B100=C1))
to get the sum
and
=SUMPRODUCT(--(B1:B100=C1))
to get the count

Change 100 to the end of your data set

to get count
--
Always provide your feedback...


"silversilver" wrote:

I have two columns, one of text and one of numbers.

I'm trying to get a sum of the cells in column A if column B has a
particular text.

For Instance:

1 AAA
2 BBB
1 CCC
3 AAA

I need a formula that counts the value of the cells in column A when column
B says AAA.

Any suggestions?


Rick Rothstein

SUMIF and IF
 
The SUMIF function will give you that...

=SUMIF(B:B,"AAA",A:A)

although, if possible, I would restrict the ranges to the smallest size that
will accommodate your data, if at all possible; for example...

=SUMIF(B1:B100,"AAA",A1:A100)

assuming your data will always fit within that specified range.

--
Rick (MVP - Excel)


"silversilver" wrote in message
...
I have two columns, one of text and one of numbers.

I'm trying to get a sum of the cells in column A if column B has a
particular text.

For Instance:

1 AAA
2 BBB
1 CCC
3 AAA

I need a formula that counts the value of the cells in column A when
column
B says AAA.

Any suggestions?




All times are GMT +1. The time now is 04:53 AM.

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