Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3
Default Countif gone wrong

Hi,

A B C D E
2000BC DEF DEF DEF 2000BC
ABC 2000BC DEF 2000BC DEF
2000BC 2000BC 2000BC 2000BC 2000BC
ABC 2000BC DEF DEF DEF

This normally works but Im having a problem with it now. My formula
looks like this
=COUNTIF(Sheet3!A:A,"=2000BC")+COUNTIF(Sheet3!B:B, "=2000BC")+COUNTIF(Sheet3!C:C,"=2000BC")+COUNTIF(S heet3!D:D,"=2000BC")+COUNTIF(Sheet3!E:E,"=2000BC")
The column range is a lot of lines ie reason why I use column:column, the
last countif was added & it returns answer as 0 instead of adding 2 more-if I
change the formula to only read =COUNTIF(Sheet3!E:E,"=2000BC") it gives me a
0.
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 5,934
Default Countif gone wrong

COUNTIF works fine and when I try it with the data you posted, this
formula...

=COUNTIF(Sheet3!E:E,"=2000BC")

returns 2, as it should. I don't know why you are getting 0, so I can't help
you with that part; however, I thought you might be interested in knowing
that this formula...

=COUNTIF(Sheet3!A:A,"=2000BC")+COUNTIF(Sheet3!B:B, "=2000BC")+COUNTIF(Sheet3!C:C,"=2000BC")+COUNTIF(S heet3!D:D,"=2000BC")+COUNTIF(Sheet3!E:E,"=2000BC")

can be replaced with this much shorter one...

=COUNTIF(Sheet3!A:E,"2000BC")

Notice that you don't need the equal sign in front of the string constant
that you are checking for.

--
Rick (MVP - Excel)



"Isis" wrote in message
...
Hi,

A B C D E
2000BC DEF DEF DEF 2000BC
ABC 2000BC DEF 2000BC DEF
2000BC 2000BC 2000BC 2000BC 2000BC
ABC 2000BC DEF DEF DEF

This normally works but Im having a problem with it now. My formula
looks like this
=COUNTIF(Sheet3!A:A,"=2000BC")+COUNTIF(Sheet3!B:B, "=2000BC")+COUNTIF(Sheet3!C:C,"=2000BC")+COUNTIF(S heet3!D:D,"=2000BC")+COUNTIF(Sheet3!E:E,"=2000BC")
The column range is a lot of lines ie reason why I use column:column, the
last countif was added & it returns answer as 0 instead of adding 2
more-if I
change the formula to only read =COUNTIF(Sheet3!E:E,"=2000BC") it gives
me a
0.

Is there an alternate formula or is there an error with column thats not
calculating?

thx


  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 11,501
Default Countif gone wrong

Hi,

Your formula works perfectly for me but can be simplified to

=COUNTIF(Sheet3!A:E,"2000BC")


If Col E is returning zero then you may have some rogue spaces so try

=COUNTIF(Sheet3!A:E,"*2000BC*")
--
Mike

When competing hypotheses are otherwise equal, adopt the hypothesis that
introduces the fewest assumptions while still sufficiently answering the
question.


"Isis" wrote:

Hi,

A B C D E
2000BC DEF DEF DEF 2000BC
ABC 2000BC DEF 2000BC DEF
2000BC 2000BC 2000BC 2000BC 2000BC
ABC 2000BC DEF DEF DEF

This normally works but Im having a problem with it now. My formula
looks like this
=COUNTIF(Sheet3!A:A,"=2000BC")+COUNTIF(Sheet3!B:B, "=2000BC")+COUNTIF(Sheet3!C:C,"=2000BC")+COUNTIF(S heet3!D:D,"=2000BC")+COUNTIF(Sheet3!E:E,"=2000BC")
The column range is a lot of lines ie reason why I use column:column, the
last countif was added & it returns answer as 0 instead of adding 2 more-if I
change the formula to only read =COUNTIF(Sheet3!E:E,"=2000BC") it gives me a
0.

Is there an alternate formula or is there an error with column thats not
calculating?

thx


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
Insert Calculated Field (wrong Qty*Price = wrong Amount) Edmund Excel Discussion (Misc queries) 8 October 4th 07 12:13 PM
COUNTIF or not to COUNTIF on a range in another sheet Ellie Excel Worksheet Functions 4 September 15th 05 10:06 PM
What am I doing wrong? Jeff Excel Discussion (Misc queries) 6 March 6th 05 03:01 AM
something wrong with my "countif" function ryanjh79 Excel Discussion (Misc queries) 3 December 17th 04 06:59 PM
What's wrong with this? drvortex Excel Worksheet Functions 0 November 3rd 04 08:51 PM


All times are GMT +1. The time now is 08:49 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"