Help with complex If statement

G

Guest

I'm not sure if this is possible or not, but it's worth a try. I'm running
Excel 2003.

I'm trying to do all of this in one cell, rather than adding an additional
column. I have two columns that I want to compare. I want to count the
instances where the cells in column B are greater than the cells in column A.
For example:

A B
1 1 3
2 5 2
3 2 4
4 6 8
5 7 2

I want a formula that will show me a count of 3, because B1, B3, and B4 are
all greater than the corresponding rows in column A. I eventually want to end
up with a percentage of numbers in B that are greater than the numbers in A,
but once I can get the count formula figured out, the percentage will be
easy. I've been able to get this done with individual "if" statements in a
separate column, but I'd really like to know if there's a way to combine it
all into 1 formula. Any ideas are appreciated!!
 
T

Terry Bennett

There may be other ways of doing this but I would use:

=SUMPRODUCT(--(A1:A5<B1:B5))
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top