Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 57
Default Countif Range not working

Hi,

I have the following entered to set a text value in column d when some other
text value is found in a cell range within columns b and c:

=IF(COUNTIF(B49:C49,"*aaa*")0,"mgr1",IF(COUNTIF(B 49,"*bbb*")0,"mgr1",IF(COUNTIF(B49,"*ccc*")0,"mg r1",IF(COUNTIF(B49,"*ddd*")0,"mgr1",IF(COUNTIF(B4 9,"*eee*")0,"mgr2",IF(COUNTIF(B49,"*fff*")0,"mgr 2","Other"))))))

This works as intended for any value containined in cells of column b, but
only works for the very first value ("aaa") in column c. In other words, if
the value of a cell within range for column c is "bbb", "Other" is returned
instead of "mgr1".

Can anyone tell me what I am doing wrong? Is there a way to have the
formula evaluate each value for both columns?

Thanks,

Tom
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,240
Default Countif Range not working

tommcbrny wrote:
Hi,

I have the following entered to set a text value in column d when some other
text value is found in a cell range within columns b and c:

=IF(COUNTIF(B49:C49,"*aaa*")0,"mgr1",IF(COUNTIF(B 49,"*bbb*")0,"mgr1",IF(COUNTIF(B49,"*ccc*")0,"mg r1",IF(COUNTIF(B49,"*ddd*")0,"mgr1",IF(COUNTIF(B4 9,"*eee*")0,"mgr2",IF(COUNTIF(B49,"*fff*")0,"mgr 2","Other"))))))

This works as intended for any value containined in cells of column b, but
only works for the very first value ("aaa") in column c. In other words, if
the value of a cell within range for column c is "bbb", "Other" is returned
instead of "mgr1".

Can anyone tell me what I am doing wrong? Is there a way to have the
formula evaluate each value for both columns?

Thanks,

Tom



You aren't referencing column C for "bbb".
  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 57
Default Countif Range not working

Oh wow, that is AWFUL proof reading on my part, sorry for the dumb post and
thanks Glenn for pointing out the error.
Tom

"Glenn" wrote:

tommcbrny wrote:
Hi,

I have the following entered to set a text value in column d when some other
text value is found in a cell range within columns b and c:

=IF(COUNTIF(B49:C49,"*aaa*")0,"mgr1",IF(COUNTIF(B 49,"*bbb*")0,"mgr1",IF(COUNTIF(B49,"*ccc*")0,"mg r1",IF(COUNTIF(B49,"*ddd*")0,"mgr1",IF(COUNTIF(B4 9,"*eee*")0,"mgr2",IF(COUNTIF(B49,"*fff*")0,"mgr 2","Other"))))))

This works as intended for any value containined in cells of column b, but
only works for the very first value ("aaa") in column c. In other words, if
the value of a cell within range for column c is "bbb", "Other" is returned
instead of "mgr1".

Can anyone tell me what I am doing wrong? Is there a way to have the
formula evaluate each value for both columns?

Thanks,

Tom



You aren't referencing column C for "bbb".

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 10,593
Default Countif Range not working

Works fine here Tom, which suggests a data problem to me.

BTW, you can reduce the formula to

=IF(SUM(COUNTIF(B49:C49,{"*aaa*","*bbb*","*ccc*"," *ddd*"})),"mgr1",IF(SUM(COUNTIF(B49,{"*eee*","*fff *"})),"mgr2","Other")))

--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

"tommcbrny" wrote in message
...
Hi,

I have the following entered to set a text value in column d when some
other
text value is found in a cell range within columns b and c:

=IF(COUNTIF(B49:C49,"*aaa*")0,"mgr1",IF(COUNTIF(B 49,"*bbb*")0,"mgr1",IF(COUNTIF(B49,"*ccc*")0,"mg r1",IF(COUNTIF(B49,"*ddd*")0,"mgr1",IF(COUNTIF(B4 9,"*eee*")0,"mgr2",IF(COUNTIF(B49,"*fff*")0,"mgr 2","Other"))))))

This works as intended for any value containined in cells of column b, but
only works for the very first value ("aaa") in column c. In other words,
if
the value of a cell within range for column c is "bbb", "Other" is
returned
instead of "mgr1".

Can anyone tell me what I am doing wrong? Is there a way to have the
formula evaluate each value for both columns?

Thanks,

Tom



  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 57
Default Countif Range not working

Thanks for the consolidation Bob, very useful!

"Bob Phillips" wrote:

Works fine here Tom, which suggests a data problem to me.

BTW, you can reduce the formula to

=IF(SUM(COUNTIF(B49:C49,{"*aaa*","*bbb*","*ccc*"," *ddd*"})),"mgr1",IF(SUM(COUNTIF(B49,{"*eee*","*fff *"})),"mgr2","Other")))

--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

"tommcbrny" wrote in message
...
Hi,

I have the following entered to set a text value in column d when some
other
text value is found in a cell range within columns b and c:

=IF(COUNTIF(B49:C49,"*aaa*")0,"mgr1",IF(COUNTIF(B 49,"*bbb*")0,"mgr1",IF(COUNTIF(B49,"*ccc*")0,"mg r1",IF(COUNTIF(B49,"*ddd*")0,"mgr1",IF(COUNTIF(B4 9,"*eee*")0,"mgr2",IF(COUNTIF(B49,"*fff*")0,"mgr 2","Other"))))))

This works as intended for any value containined in cells of column b, but
only works for the very first value ("aaa") in column c. In other words,
if
the value of a cell within range for column c is "bbb", "Other" is
returned
instead of "mgr1".

Can anyone tell me what I am doing wrong? Is there a way to have the
formula evaluate each value for both columns?

Thanks,

Tom






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
Countif not working c mateland Excel Worksheet Functions 3 September 3rd 07 02:46 AM
CountIf Array not working NWO Excel Discussion (Misc queries) 1 March 1st 07 07:48 PM
Countif, not working. Clash Excel Discussion (Misc queries) 2 July 20th 06 11:28 AM
countif not working Nick Krill Excel Discussion (Misc queries) 4 June 24th 06 07:42 PM
COUNTIF or not to COUNTIF on a range in another sheet Ellie Excel Worksheet Functions 4 September 15th 05 10:06 PM


All times are GMT +1. The time now is 01:02 PM.

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

About Us

"It's about Microsoft Excel"