ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   If (A1 = "ValueA" & C1 = "ValueB") return the quantity of matches (https://www.excelbanter.com/excel-discussion-misc-queries/148584-if-a1-%3D-valuea-c1-%3D-valueb-return-quantity-matches.html)

DaveC

If (A1 = "ValueA" & C1 = "ValueB") return the quantity of matches
 
Using data looking something similar to below....

Column A Column B Column C
Red 1 Santa
Blue 1 Santa
Red 1 Elf

What formula do I use if I want to count the amount of times Col A = Red and
Col C = Santa?

Had no luck so far using variations of....
=SUM(IF(Data!H:H="Red",IF(Data!J:J="Santa",1,0)))


Rick Rothstein \(MVP - VB\)

If (A1 = "ValueA" & C1 = "ValueB") return the quantity of matches
 
Using data looking something similar to below....

Column A Column B Column C
Red 1 Santa
Blue 1 Santa
Red 1 Elf

What formula do I use if I want to count the amount of times Col A = Red
and
Col C = Santa?

Had no luck so far using variations of....
=SUM(IF(Data!H:H="Red",IF(Data!J:J="Santa",1,0)))


Try this...

=SUMPRODUCT((A1:A1000="Red")*(C1:C1000="Santa"))

Use a number larger than the largest row of data you will ever have in place
of my 1000s.

Rick


DaveC

If (A1 = "ValueA" & C1 = "ValueB") return the quantity of matc
 
THANK YOU!

I've been racking my brains for a while trying to get this to work.
Appreciate the help

"Rick Rothstein (MVP - VB)" wrote:

Using data looking something similar to below....

Column A Column B Column C
Red 1 Santa
Blue 1 Santa
Red 1 Elf

What formula do I use if I want to count the amount of times Col A = Red
and
Col C = Santa?

Had no luck so far using variations of....
=SUM(IF(Data!H:H="Red",IF(Data!J:J="Santa",1,0)))


Try this...

=SUMPRODUCT((A1:A1000="Red")*(C1:C1000="Santa"))

Use a number larger than the largest row of data you will ever have in place
of my 1000s.

Rick




All times are GMT +1. The time now is 07:06 PM.

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