Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
creativeops
 
Posts: n/a
Default count if range contains match to another cell

I have an array of data on 1 sheet that contains (among other things) a
straightforward date column and also a column in which some of the cells
contain the word "New". I would like to count the rows that have both the
word "New", and also a date which falls within the month found in a cell on
another sheet. But, the date on the other sheet is not in date format and
can't be, because it has to be the 3-letter abbreviation of the month in all
caps (i.e. FEB) in order for the formulas on that sheet to work.
Yikes! Thank you....
Ross
  #2   Report Post  
Posted to microsoft.public.excel.misc
cvolkert
 
Posts: n/a
Default count if range contains match to another cell


I think the formula below should do the trick for you counting issue.
In the formula, you need to change the following:

A2:a20 is your range of dates
G8 is the range where you would enter FEB
B2:b20 is the range that would have New in it

=SUMPRODUCT((TEXT($A$2:$A$20,"MMM")=G8)*($B$2:$B$2 0="New"))

Let me know if you have any problems with this - I tested it quickly
and it seemed to work. Later - Chad


--
cvolkert
------------------------------------------------------------------------
cvolkert's Profile: http://www.excelforum.com/member.php...o&userid=24380
View this thread: http://www.excelforum.com/showthread...hreadid=514643

  #3   Report Post  
Posted to microsoft.public.excel.misc
creativeops
 
Posts: n/a
Default count if range contains match to another cell

Hmm...thanks Chad, seems like a good start, but...
When I use your formula as is, I get #######. Maybe (I thought) because my
date range (E7:E100) is in date format 1-Jan-06? Also, those date values, in
case it matters, are populated via a formula that references a totally
different document.
I changed it to this, but now get a #VALUE error:

=SUMPRODUCT((TEXT((MONTH($E$7:$E$100)),"MMM")=Exec Sum!H7)*($F$7:$F$100="New"))
thinking that would convert the date range to their month code?

Do I change the "MMM"? I tried it to no avail. But if so, the idea is to
not have to change this formula - so when users change the month on the other
sheet (ExecSum!H7), they don't need to change the formula on this sheet.

also, just a stupid question that I should know - what do the dollar signs
mean?

Thanks!
Ross

"cvolkert" wrote:


I think the formula below should do the trick for you counting issue.
In the formula, you need to change the following:

A2:a20 is your range of dates
G8 is the range where you would enter FEB
B2:b20 is the range that would have New in it

=SUMPRODUCT((TEXT($A$2:$A$20,"MMM")=G8)*($B$2:$B$2 0="New"))

Let me know if you have any problems with this - I tested it quickly
and it seemed to work. Later - Chad


--
cvolkert
------------------------------------------------------------------------
cvolkert's Profile: http://www.excelforum.com/member.php...o&userid=24380
View this thread: http://www.excelforum.com/showthread...hreadid=514643


  #4   Report Post  
Posted to microsoft.public.excel.misc
cvolkert
 
Posts: n/a
Default count if range contains match to another cell


I'm not sure why the first formula won't work on your end. I tried it
again and it worked on my end (I did have to delete the space between
the 2 & the 0 in the latter part of the formula. You definitely don't
want to convert to the month number (using the Month function) or you
will get January for anything you put in there. One thing you may want
to try is format the cell where the formula is as a number - if it is a
date or something else that may be causing the #### which typically
means the cell contents are too large for the cell.

As for the $ - they make a range absolute. For instance, if you key a
formula in without $ and then drag it down or to the side, the cell
references in the formula will move relative to where the formula is.
this is usually not something people want to have happen.


--
cvolkert
------------------------------------------------------------------------
cvolkert's Profile: http://www.excelforum.com/member.php...o&userid=24380
View this thread: http://www.excelforum.com/showthread...hreadid=514643

  #5   Report Post  
Posted to microsoft.public.excel.misc
creativeops
 
Posts: n/a
Default count if range contains match to another cell

Oh! Yeah the cell was just formatted wrong! Well, that worked to make the
formula give a value instead of ####.
But...the value is 0 which isn't correct.
Currently, I for the formula I have:

=SUMPRODUCT((TEXT($E$7:$E$100,"MMM")=ExecSum!H7)*( $F$7:$F$100="*New*"))

ExecSum!H7 contains the plain text value of FEB
There is one cell in E7:E100 that contains both a Feb date (1-Feb-06 to be
exact, and that is the product of a formula pointing to another document) AND
"New" within the value of it's cell in column F (not just 'New' though as
there's other stuff in that cell also, hence the asterisks). So, the value
should be 1, but it's 0.

So glad to know about the $. That would've saved me a lot of work. oh well
- now i know - thanks!
Ross

"cvolkert" wrote:


I'm not sure why the first formula won't work on your end. I tried it
again and it worked on my end (I did have to delete the space between
the 2 & the 0 in the latter part of the formula. You definitely don't
want to convert to the month number (using the Month function) or you
will get January for anything you put in there. One thing you may want
to try is format the cell where the formula is as a number - if it is a
date or something else that may be causing the #### which typically
means the cell contents are too large for the cell.

As for the $ - they make a range absolute. For instance, if you key a
formula in without $ and then drag it down or to the side, the cell
references in the formula will move relative to where the formula is.
this is usually not something people want to have happen.


--
cvolkert
------------------------------------------------------------------------
cvolkert's Profile: http://www.excelforum.com/member.php...o&userid=24380
View this thread: http://www.excelforum.com/showthread...hreadid=514643




  #6   Report Post  
Posted to microsoft.public.excel.misc
cvolkert
 
Posts: n/a
Default count if range contains match to another cell


I didn't realize there would be other text other than just New in the
second range. Putting * between the quotes does not create wildcards
so that's why you were getting 0 - it was looking for the exact text
*New*. The formula below works around this. I don't know what other
text could be in this column, but note that words containing 'New' will
also return a positive. Perhaps unlikely, but something like Newton
would return a positive. Let me know if you need anything else.

=SUMPRODUCT((TEXT($E$7:$E$100,"MMM")=ExecSumm!H7)* (1-ISERROR(FIND("New",$F$7:$F$100))))


--
cvolkert
------------------------------------------------------------------------
cvolkert's Profile: http://www.excelforum.com/member.php...o&userid=24380
View this thread: http://www.excelforum.com/showthread...hreadid=514643

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
count cell if value present in every other cell + criteria lrbest4x4xfar Excel Worksheet Functions 2 September 26th 05 01:30 AM
How to count a range of values in a single cell? nyc_doc Excel Worksheet Functions 3 August 3rd 05 12:30 AM
Possible Lookup Table Karen Excel Worksheet Functions 5 June 8th 05 09:43 PM
Look for change next blank cell in Range Nigel Bennett Excel Worksheet Functions 1 March 13th 05 09:45 PM
Returning a Value to a Cell Based on a Range of Uncertain Size amc422 Excel Worksheet Functions 7 November 14th 04 03:03 PM


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