Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
lawoman35
 
Posts: n/a
Default Excel 2003, which formula will count the cells that meet 2 conditi

I would like to use a formula like COUNTIF or SUMPRODUCT to test two ranges.
I want the formula to return the value of the number of cells that meet the
two conditions. Both columns contain TEXT, not numbers.

Like this:
=COUNTIF(--(Sheet1!B:B, "Move-In"),--(Sheet1!E:E,"A1"))

So if there are 10 Move-Ins with Type A1, then the value 10 would be
calulated.

  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
 
Posts: n/a
Default Excel 2003, which formula will count the cells that meet 2 conditi

Hi

If all the data is text, what do you mean by 'value of the number of
cells'?
Try this:
=SUMPRODUCT(--(Sheet1!B1:B1000="Move-In"),--(Sheet1!E1:E1000 = "A1"))
You cannot use full column ranges with SUMPRODUCT, and the ranges must be
the same size.

Andy.

"lawoman35" wrote in message
...
I would like to use a formula like COUNTIF or SUMPRODUCT to test two
ranges.
I want the formula to return the value of the number of cells that meet
the
two conditions. Both columns contain TEXT, not numbers.

Like this:
=COUNTIF(--(Sheet1!B:B, "Move-In"),--(Sheet1!E:E,"A1"))

So if there are 10 Move-Ins with Type A1, then the value 10 would be
calulated.



  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
lawoman35
 
Posts: n/a
Default Excel 2003, which formula will count the cells that meet 2 con

Thanks Andy. If I have 10 new residents or "Move-in"s and they all moved
into an "A1" unit type, then my formula should count them and return the
number 10.

I revised the formula and it returns zero. I just read in my Excel book
that SUMPRODUCT treats nonnumeric entries as zero. I wonder if I should go a
differnt route and use LOOKUP.

"Andy" wrote:

Hi

If all the data is text, what do you mean by 'value of the number of
cells'?
Try this:
=SUMPRODUCT(--(Sheet1!B1:B1000="Move-In"),--(Sheet1!E1:E1000 = "A1"))
You cannot use full column ranges with SUMPRODUCT, and the ranges must be
the same size.

Andy.

"lawoman35" wrote in message
...
I would like to use a formula like COUNTIF or SUMPRODUCT to test two
ranges.
I want the formula to return the value of the number of cells that meet
the
two conditions. Both columns contain TEXT, not numbers.

Like this:
=COUNTIF(--(Sheet1!B:B, "Move-In"),--(Sheet1!E:E,"A1"))

So if there are 10 Move-Ins with Type A1, then the value 10 would be
calulated.




  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Mikeopolo
 
Posts: n/a
Default Excel 2003, which formula will count the cells that meet 2 conditi


I think the sumproduct formula posted above should have read:

=SUMPRODUCT(--(Sheet1!B1:B1000="Move-In")*--(Sheet1!E1:E1000 = "A1"))

Rgds
Mike


--
Mikeopolo
------------------------------------------------------------------------
Mikeopolo's Profile: http://www.excelforum.com/member.php...o&userid=18570
View this thread: http://www.excelforum.com/showthread...hreadid=525709

  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Kevin Vaughn
 
Posts: n/a
Default Excel 2003, which formula will count the cells that meet 2 con

I don't see anything wrong with the proferred formula. You might want to
recheck your data. For instance, for a test, I entered some dummy
information in columns A and B and used the following formula and got the
expected results:

=SUMPRODUCT(--(A20:A31 = "Move-in"), --(B20:B31 = "A1"))

Assuming that your data is where you indicated and there are no hidden
spaces or funny characters, the formula should work. Try moving the parts of
the formula you are checking for and making sure it truly matches with what
is in your lookup range. In other words, copy the string Move-in directly
from your formula into a cell and trying a formula like, if you copied
Move-in to A1, =A1 = B25 (if B25 contains that string.) If it doesn't return
true, check for trailing spaces or maybe you used -- rather than -. It
probably isn't a formatting issue in this case, but if you were looking for a
number and it was formatted as text, your lookup would almost certainly fail.
--
Kevin Vaughn


"lawoman35" wrote:

Thanks Andy. If I have 10 new residents or "Move-in"s and they all moved
into an "A1" unit type, then my formula should count them and return the
number 10.

I revised the formula and it returns zero. I just read in my Excel book
that SUMPRODUCT treats nonnumeric entries as zero. I wonder if I should go a
differnt route and use LOOKUP.

"Andy" wrote:

Hi

If all the data is text, what do you mean by 'value of the number of
cells'?
Try this:
=SUMPRODUCT(--(Sheet1!B1:B1000="Move-In"),--(Sheet1!E1:E1000 = "A1"))
You cannot use full column ranges with SUMPRODUCT, and the ranges must be
the same size.

Andy.

"lawoman35" wrote in message
...
I would like to use a formula like COUNTIF or SUMPRODUCT to test two
ranges.
I want the formula to return the value of the number of cells that meet
the
two conditions. Both columns contain TEXT, not numbers.

Like this:
=COUNTIF(--(Sheet1!B:B, "Move-In"),--(Sheet1!E:E,"A1"))

So if there are 10 Move-Ins with Type A1, then the value 10 would be
calulated.




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
Excel 2003 FAILS, but Excel 2000 SUCCEEDS ??? Richard Excel Discussion (Misc queries) 2 May 13th 23 11:46 AM
Formula Auditing Bug ? (Excel 2003) ksp Excel Worksheet Functions 0 October 5th 05 11:07 AM
EDIT FORMULA BAR in excel 2003? why not? where is it? alnav89 Excel Worksheet Functions 2 April 26th 05 07:02 PM
Excel 2003 will not display color fonts or color fill cells DaveC Excel Worksheet Functions 1 April 11th 05 04:38 PM
count non blank cells which meet criteria in another column cmarsh5035 Excel Worksheet Functions 2 February 16th 05 04:32 PM


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