Solved IF statement with 2 criteria

December 19, 2013 at 02:17:38
Specs: Windows XP
aNY hELP APPRICIATED,

I WANT TO ACHIEVE AN ANSWER BASED ON THE INFORMATION FROM 2 OTHER CELLS
IE.
IF CELL A1 : A500 = "NORTH" AND CELL B1:B500 = "LTB" THEN THE ANSWER IS (QTY OF ARGUMENTS THAT IF THE CRITERA) otherwise 0


See More: IF statement with 2 criteria

Report •

#1
December 19, 2013 at 20:55:45
✔ Best Answer
First, let me bring up 2 issues with your post..

1 - Please refrain from posting in all caps. Posting in all caps is the internet equivalent of yelling and most folks don't like to be yelled at.

2 - In the future, please use a subject line that is relevant to your question. If everyone used a generic subject line like yours, we wouldn't be able to tell one question from another and the archives would basically be useless. I have edited the subject line of this thread as an example of how it should look.

Thanks!

DerbyDad03
Office Forum Moderator

Click Here Before Posting Data or VBA Code ---> How To Post Data or Code.


Report •

#2
December 19, 2013 at 21:04:46
Are you looking for the count of cells where a cell in Column A = NORTH and a cell in the same Row in Column B = LBT? If so, try this:

=SUMPRODUCT((A1:A500="NORTH")*(B1:B500="LBT"))

If that is not what you are looking for, please provide a little more detail.

Click Here Before Posting Data or VBA Code ---> How To Post Data or Code.


Report •

#3
December 20, 2013 at 11:24:25
Sorry DerbyDad03
for the lapse in protocol, new to this lark
using the code you provided works, thanks very much,
however, in some of the cells is the No 1, using
=SUMPRODUCT((A1:A500="NORTH")*(B1:B500="1"))
.the result is always zero. If I change the 1 to a letter, then it works.
Is there a different formula I can use.
I will appricate your help


Report •

Related Solutions

#4
December 20, 2013 at 18:38:09
Drop the quotes around the 1.

The quotes tell Excel that whatever is between them is a text string. I assume the 1 in the cell is a number. With the quotes SUMPRODUCT is looking for a text 1 and won't recognize the number 1.

Let us know how that works out.

Click Here Before Posting Data or VBA Code ---> How To Post Data or Code.


Report •

#5
December 21, 2013 at 04:11:40
Excellant, did the job fine

Report •

Ask Question