ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   IF THEN statements (https://www.excelbanter.com/excel-discussion-misc-queries/252012-if-then-statements.html)

perale

IF THEN statements
 
I have 2 columns A & B. I want Xcel to first look at Column A and IF it
contains the number 1, then go to Column B and count how many A-1's there
are. This is my formula - it's giving me a FALSE answer but I need a number.


=IF($A$2:$A$174="1",COUNTIF($B$2:$B$174,"A-1")

Sean Timmons

IF THEN statements
 
Are you wanting to do a lookup for the number one in any cell n A???

=IF(ISERROR(VLOOKUP(1,A:A,1,0)),"",COUNTIF($B$2:$B $174,"A-1"))

"perale" wrote:

I have 2 columns A & B. I want Xcel to first look at Column A and IF it
contains the number 1, then go to Column B and count how many A-1's there
are. This is my formula - it's giving me a FALSE answer but I need a number.


=IF($A$2:$A$174="1",COUNTIF($B$2:$B$174,"A-1")


Mike H

IF THEN statements
 
Hi,

I'm not entirely sure I understand what you mean by A-1 and have assumed you
mean text.

=SUMPRODUCT((A2:A174=1)*(B2:B174="A-1"))

Mike

"perale" wrote:

I have 2 columns A & B. I want Xcel to first look at Column A and IF it
contains the number 1, then go to Column B and count how many A-1's there
are. This is my formula - it's giving me a FALSE answer but I need a number.


=IF($A$2:$A$174="1",COUNTIF($B$2:$B$174,"A-1")


Rick Rothstein

IF THEN statements
 
Try this formula instead...

=SUMPRODUCT(($A2:$A$174=1)*($B$2:$B$174="A-1"))

--
Rick (MVP - Excel)


"perale" wrote in message
...
I have 2 columns A & B. I want Xcel to first look at Column A and IF it
contains the number 1, then go to Column B and count how many A-1's there
are. This is my formula - it's giving me a FALSE answer but I need a
number.


=IF($A$2:$A$174="1",COUNTIF($B$2:$B$174,"A-1")



JLatham

IF THEN statements
 
Try
=SUMPRODUCT(--($A$2:$A$174=1),--($B$2:$B$174="A-1"))
That assumes that the values in column A are actual number, if they are text
then
=SUMPRODUCT(--($A$2:$A$174="1"),--($B$2:$B$174="A-1"))

"perale" wrote:

I have 2 columns A & B. I want Xcel to first look at Column A and IF it
contains the number 1, then go to Column B and count how many A-1's there
are. This is my formula - it's giving me a FALSE answer but I need a number.


=IF($A$2:$A$174="1",COUNTIF($B$2:$B$174,"A-1")


perale

IF THEN statements
 
Yes I am i.e. I have groups 1 - 13 listed in Column A. I want Xcel to go to
Column A, find any Group 1 and if that criteria exists, go to Column B and
see if there are any A-1's and if there are give me a total of how many there
are. In other words how many people in Group 1 fall in the A-1 category?

"Sean Timmons" wrote:

Are you wanting to do a lookup for the number one in any cell n A???

=IF(ISERROR(VLOOKUP(1,A:A,1,0)),"",COUNTIF($B$2:$B $174,"A-1"))

"perale" wrote:

I have 2 columns A & B. I want Xcel to first look at Column A and IF it
contains the number 1, then go to Column B and count how many A-1's there
are. This is my formula - it's giving me a FALSE answer but I need a number.


=IF($A$2:$A$174="1",COUNTIF($B$2:$B$174,"A-1")


perale

IF THEN statements
 
Thanks Rick. That worked.

"Rick Rothstein" wrote:

Try this formula instead...

=SUMPRODUCT(($A2:$A$174=1)*($B$2:$B$174="A-1"))

--
Rick (MVP - Excel)


"perale" wrote in message
...
I have 2 columns A & B. I want Xcel to first look at Column A and IF it
contains the number 1, then go to Column B and count how many A-1's there
are. This is my formula - it's giving me a FALSE answer but I need a
number.


=IF($A$2:$A$174="1",COUNTIF($B$2:$B$174,"A-1")


.



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

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