![]() |
![]() |
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
New Member
Join Date: Mar 2002
Posts: 5
|
I am trying to count the number of times a conditional value occurs in a spreadsheet. I would like to check column A:1-end for a value "AAA". If true then check column D, same row for one of 3 values. If any are true add 1 to the total. I have tried this:
=sum(if(a1:A100="aaa",if(d1:d100="LB",1,0),0)) as an array function and it works but only for one conditional occurance. Can I check for all three with one statment? I.E. If col-a="aaa" and (col-d = ("LB" or "PR" or "MG") , add 1 to total. |
|
|
|
|
|
#2 | |
|
MrExcel MVP
Join Date: Feb 2002
Location: The Hague
Posts: 50,317
|
Quote:
=SUMPRODUCT((A2:A4="aaa")*(D2:D4={"LB","PR","MG"})) |
|
|
|
|
|
|
#3 | ||
|
New Member
Join Date: Mar 2002
Posts: 5
|
Quote:
|
||
|
|
|
|
|
#4 | |||
|
MrExcel MVP
Join Date: Feb 2002
Location: The Hague
Posts: 50,317
|
Quote:
=SUMPRODUCT(((A2:A4="aaa")*(D2:D4={"LB","PR","MG"})+(A2:A4="X")*(D2:D4={"LB","PR","MG"}))) Aladin |
|||
|
|
|
|
|
#5 | ||||
|
New Member
Join Date: Mar 2002
Posts: 5
|
Quote:
LB |
||||
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|