ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Help with complex If statement (https://www.excelbanter.com/excel-worksheet-functions/157370-help-complex-if-statement.html)

GHawkins[_2_]

Help with complex If statement
 
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!!

Teethless mama

Help with complex If statement
 
=SUMPRODUCT(--(B1:B5A1:A5))

The formula above returns 3


"GHawkins" wrote:

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!!


Terry Bennett

Help with complex If statement
 
There may be other ways of doing this but I would use:

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



"GHawkins" wrote in message
...
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!!





All times are GMT +1. The time now is 12:54 PM.

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