#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 6
Default 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")
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1,696
Default 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")

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,501
Default 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")

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 5,934
Default 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")


  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,203
Default 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")



  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 6
Default 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")

  #7   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 6
Default 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")


.

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
If Statements Sr Accountant[_2_] Excel Discussion (Misc queries) 3 October 12th 07 07:45 PM
if then statements Rhonda Excel Worksheet Functions 6 September 6th 07 02:22 PM
IF statements Excel Function Application[_2_] New Users to Excel 9 June 30th 07 02:54 PM
IF Statements (Mutliple Statements) Deezel Excel Worksheet Functions 3 October 19th 06 06:13 AM
using if statements LAybar Excel Worksheet Functions 4 March 20th 06 02:55 PM


All times are GMT +1. The time now is 05:26 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"