Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Spreadsheet
 
Posts: n/a
Default COUNTIF problem with NOW()


=COUNTIF(ALL!AC2:AC1000,"<NOW()-21")

This is the formula I'm using. I'm trying to determine how many dates
in column AC are more than three weeks ago. It's returning a 0 even
though it shouldn't. Can anyone see why? THanks.


--
Spreadsheet
------------------------------------------------------------------------
Spreadsheet's Profile: http://www.excelforum.com/member.php...o&userid=34730
View this thread: http://www.excelforum.com/showthread...hreadid=555028

  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Franz Verga
 
Posts: n/a
Default COUNTIF problem with NOW()

Nel post
*Spreadsheet* ha scritto:

=COUNTIF(ALL!AC2:AC1000,"<NOW()-21")

This is the formula I'm using. I'm trying to determine how many dates
in column AC are more than three weeks ago. It's returning a 0 even
though it shouldn't. Can anyone see why? THanks.



Hi,

try this:

=COUNTIF(A2:A49,"<"&TODAY()-21)

in this case you should prefer TODAY instead of NOW, because you don't need
the time, just th day.

--
Hope I helped you.

Thanks in advance for your feedback.

Ciao

Franz Verga from Italy


  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
SteveG
 
Posts: n/a
Default COUNTIF problem with NOW()


The NOW formula should not be in quotes.

=COUNTIF(ALL!AC2:AC1000,"<"&NOW()-21)

HTH

Steve


--
SteveG
------------------------------------------------------------------------
SteveG's Profile: http://www.excelforum.com/member.php...fo&userid=7571
View this thread: http://www.excelforum.com/showthread...hreadid=555028

  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Spreadsheet
 
Posts: n/a
Default COUNTIF problem with NOW()


Thanks for replying. I'm now using
=COUNTIF(ALL!AC2:AC1000,"<"&TODAY()-21)

However, I'm having another problem. What I need to do is this:

Of all of the dates more than three weeks ago in column AC, how many of
those have a blank cell in column AG?


--
Spreadsheet
------------------------------------------------------------------------
Spreadsheet's Profile: http://www.excelforum.com/member.php...o&userid=34730
View this thread: http://www.excelforum.com/showthread...hreadid=555028



  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Franz Verga
 
Posts: n/a
Default COUNTIF problem with NOW()

Nel post
*Spreadsheet* ha scritto:

Thanks for replying. I'm now using
=COUNTIF(ALL!AC2:AC1000,"<"&TODAY()-21)

However, I'm having another problem. What I need to do is this:

Of all of the dates more than three weeks ago in column AC, how many
of those have a blank cell in column AG?



You can use this one:

=SUMPRODUCT((ALL!AC2:AC1000<(TODAY()-21))*(ALL!AG2:AG1000=""))

--
(I'm not sure of names of menues, option and commands, because
translating from the Italian version of Excel...)

Hope I helped you.

Thanks in advance for your feedback.

Ciao

Franz Verga from Italy


  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Spreadsheet
 
Posts: n/a
Default COUNTIF problem with NOW()


Franz,

I'm not sure why you suggested SUMPRODUCT. I'm only interested in a
count.


--
Spreadsheet
------------------------------------------------------------------------
Spreadsheet's Profile: http://www.excelforum.com/member.php...o&userid=34730
View this thread: http://www.excelforum.com/showthread...hreadid=555028

  #8   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Franz Verga
 
Posts: n/a
Default COUNTIF problem with NOW()

Nel post
*Spreadsheet* ha scritto:

Franz,

I'm not sure why you suggested SUMPRODUCT. I'm only interested in a
count.


Trust me. This *is* a count...


--
(I'm not sure of names of menues, option and commands, because
translating from the Italian version of Excel...)

Hope I helped you.

Thanks in advance for your feedback.

Ciao

Franz Verga from Italy


  #9   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Spreadsheet
 
Posts: n/a
Default COUNTIF problem with NOW()


The reason I wasn't sure that this was a count is because the formula
resulted in a number much larger than the correct answer. Do you have
any other suggestions? Thanks.


--
Spreadsheet
------------------------------------------------------------------------
Spreadsheet's Profile: http://www.excelforum.com/member.php...o&userid=34730
View this thread: http://www.excelforum.com/showthread...hreadid=555028

  #10   Report Post  
Posted to microsoft.public.excel.worksheet.functions
SteveG
 
Posts: n/a
Default COUNTIF problem with NOW()


Could you post a sample of your data and what the result should be?

Steve


--
SteveG
------------------------------------------------------------------------
SteveG's Profile: http://www.excelforum.com/member.php...fo&userid=7571
View this thread: http://www.excelforum.com/showthread...hreadid=555028



  #11   Report Post  
Posted to microsoft.public.excel.worksheet.functions
SteveG
 
Posts: n/a
Default COUNTIF problem with NOW()


Sorry, I put it together based on your previous posts. Franz's
solution should do it for you.

Regards

Steve


--
SteveG
------------------------------------------------------------------------
SteveG's Profile: http://www.excelforum.com/member.php...fo&userid=7571
View this thread: http://www.excelforum.com/showthread...hreadid=555028

  #12   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Don Guillett
 
Posts: n/a
Default COUNTIF problem with NOW()

try this
=SUMPRODUCT((ALL!AC2:AC1000<(TODAY()-21))*(ALL!AG2:AG1000=" "))
or
=SUMPRODUCT((ALL!AC2:AC1000<(TODAY()-21))*(len(ALL!AG2:AG1000)1))
or
=SUMPRODUCT((ALL!AC2:AC1000<(TODAY()-21))*(isnumber(ALL!AG2:AG1000)))

--
Don Guillett
SalesAid Software

"Spreadsheet"
wrote in message
...

The reason I wasn't sure that this was a count is because the formula
resulted in a number much larger than the correct answer. Do you have
any other suggestions? Thanks.


--
Spreadsheet
------------------------------------------------------------------------
Spreadsheet's Profile:
http://www.excelforum.com/member.php...o&userid=34730
View this thread: http://www.excelforum.com/showthread...hreadid=555028



  #13   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Spreadsheet
 
Posts: n/a
Default COUNTIF problem with NOW()


Ok, THanks Franz. Your solution does work. However, the reason why I was
getting a very large number is because I was using:
=SUMPRODUCT((ALL!AC2:AC1000<(TODAY()-21))*(ALL!AG2:AG1000=""))

However, I only have data up until row 157. So I changed it to:
=SUMPRODUCT((ALL!AC2:AC157<(TODAY()-21))*(ALL!AG2:AG157=""))

How can the formula be modified so that it counts the number of blank
cells in AG that have the correct data in AC but doesn't add the number
of blank cells in AG that have no date in AC. In other words, I don't
want to have to manually change the 157 to 158 when I add a new row.

Thanks.


--
Spreadsheet
------------------------------------------------------------------------
Spreadsheet's Profile: http://www.excelforum.com/member.php...o&userid=34730
View this thread: http://www.excelforum.com/showthread...hreadid=555028

  #14   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Spreadsheet
 
Posts: n/a
Default COUNTIF problem with NOW()


Spreadsheet Wrote:
Ok, THanks Franz. Your solution does work. However, the reason why I was
getting a very large number is because I was using:
=SUMPRODUCT((ALL!AC2:AC1000<(TODAY()-21))*(ALL!AG2:AG1000=""))

However, I only have data up until row 157. So I changed it to:
=SUMPRODUCT((ALL!AC2:AC157<(TODAY()-21))*(ALL!AG2:AG157=""))

How can the formula be modified so that it counts the number of blank
cells in AG that have the correct data in AC but doesn't add the number
of blank cells in AG that have no date in AC. In other words, I don't
want to have to manually change the 157 to 158 when I add a new row.

Thanks.


Does anyone have any ideas, thanks.


--
Spreadsheet
------------------------------------------------------------------------
Spreadsheet's Profile: http://www.excelforum.com/member.php...o&userid=34730
View this thread: http://www.excelforum.com/showthread...hreadid=555028

  #15   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Franz Verga
 
Posts: n/a
Default COUNTIF problem with NOW()

Nel post
*Spreadsheet* ha scritto:

Ok, THanks Franz. Your solution does work. However, the reason why I
was getting a very large number is because I was using:
=SUMPRODUCT((ALL!AC2:AC1000<(TODAY()-21))*(ALL!AG2:AG1000=""))

However, I only have data up until row 157. So I changed it to:
=SUMPRODUCT((ALL!AC2:AC157<(TODAY()-21))*(ALL!AG2:AG157=""))

How can the formula be modified so that it counts the number of blank
cells in AG that have the correct data in AC but doesn't add the
number of blank cells in AG that have no date in AC. In other words,
I don't want to have to manually change the 157 to 158 when I add a
new row.



I think this sould do the job:

=SUMPRODUCT((INDIRECT("ALL!AC2:AC"&COUNTA(AC2:AC)) <(TODAY()-21))*(INDIRECT("ALL!AG2:AG"&COUNTA(AG2:AG))=""))

--
Hope I helped you.

Thanks in advance for your feedback.

Ciao

Franz Verga from Italy




  #16   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Franz Verga
 
Posts: n/a
Default COUNTIF problem with NOW()

Nel post
*Franz Verga* ha scritto:

Nel post
*Spreadsheet* ha scritto:

Ok, THanks Franz. Your solution does work. However, the reason why I
was getting a very large number is because I was using:
=SUMPRODUCT((ALL!AC2:AC1000<(TODAY()-21))*(ALL!AG2:AG1000=""))

However, I only have data up until row 157. So I changed it to:
=SUMPRODUCT((ALL!AC2:AC157<(TODAY()-21))*(ALL!AG2:AG157=""))

How can the formula be modified so that it counts the number of blank
cells in AG that have the correct data in AC but doesn't add the
number of blank cells in AG that have no date in AC. In other words,
I don't want to have to manually change the 157 to 158 when I add a
new row.



I think this sould do the job:

=SUMPRODUCT((INDIRECT("ALL!AC2:AC"&COUNTA(AC2:AC)) <(TODAY()-21))*(INDIRECT("ALL!AG2:AG"&COUNTA(AG2:AG))=""))



The formula should be correct in this way:

=SUMPRODUCT((INDIRECT("ALL!AC2:AC"&COUNTA(AC:AC))< (TODAY()-21))*(INDIRECT("ALL!AG2:AG"&COUNTA(AG:AG))=""))

Errors due to copy & past... :-)

--
Hope I helped you.

Thanks in advance for your feedback.

Ciao

Franz Verga from Italy


  #17   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Ragdyer
 
Posts: n/a
Default COUNTIF problem with NOW()

This should work for you:

=SUMPRODUCT((ALL!AC2:AC1000<"")*(ALL!AC2:AC1000<( TODAY()-21))*(ALL!AG2:AG1000=""))

--
HTH,

RD

---------------------------------------------------------------------------
Please keep all correspondence within the NewsGroup, so all may benefit !
---------------------------------------------------------------------------
"Spreadsheet"
wrote in message
...

Spreadsheet Wrote:
Ok, THanks Franz. Your solution does work. However, the reason why I was
getting a very large number is because I was using:
=SUMPRODUCT((ALL!AC2:AC1000<(TODAY()-21))*(ALL!AG2:AG1000=""))

However, I only have data up until row 157. So I changed it to:
=SUMPRODUCT((ALL!AC2:AC157<(TODAY()-21))*(ALL!AG2:AG157=""))

How can the formula be modified so that it counts the number of blank
cells in AG that have the correct data in AC but doesn't add the number
of blank cells in AG that have no date in AC. In other words, I don't
want to have to manually change the 157 to 158 when I add a new row.

Thanks.


Does anyone have any ideas, thanks.


--
Spreadsheet
------------------------------------------------------------------------
Spreadsheet's Profile:
http://www.excelforum.com/member.php...o&userid=34730
View this thread: http://www.excelforum.com/showthread...hreadid=555028


  #18   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Spreadsheet
 
Posts: n/a
Default COUNTIF problem with NOW()


The formula you gave me returns a Zero (it shouldn't). Does anything
need to be changed?


--
Spreadsheet
------------------------------------------------------------------------
Spreadsheet's Profile: http://www.excelforum.com/member.php...o&userid=34730
View this thread: http://www.excelforum.com/showthread...hreadid=555028

  #19   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Franz Verga
 
Posts: n/a
Default COUNTIF problem with NOW()

Spreadsheet wrote:
The formula you gave me returns a Zero (it shouldn't). Does anything
need to be changed?


In my last post I told you to correct the formula: there was a mistake due
to copy & past, so the correct formula is:

=SUMPRODUCT((INDIRECT("ALL!AC2:AC"&COUNTA(AC:AC))< (TODAY()-21))*(INDIRECT("ALL!AG2:AG"&COUNTA(AG:AG))=""))

If the formula returne you azero, maybe your dates are formatted as text...

--
Hope I helped you.

Thanks in advance for your feedback.

Ciao

Franz Verga from Italy


  #20   Report Post  
Posted to microsoft.public.excel.worksheet.functions
SteveG
 
Posts: n/a
Default COUNTIF problem with NOW()


This should work,

=SUMPRODUCT(ISNUMBER(ALL!AC2:AC1000)*(ALL!AC2:AC10 00<(TODAY()-21))*(ALL!AG2:AG1000=""))



HTH

Steve


--
SteveG
------------------------------------------------------------------------
SteveG's Profile: http://www.excelforum.com/member.php...fo&userid=7571
View this thread: http://www.excelforum.com/showthread...hreadid=555028



  #21   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Spreadsheet
 
Posts: n/a
Default COUNTIF problem with NOW()


thanks, its working fine now.


--
Spreadsheet
------------------------------------------------------------------------
Spreadsheet's Profile: http://www.excelforum.com/member.php...o&userid=34730
View this thread: http://www.excelforum.com/showthread...hreadid=555028

  #22   Report Post  
Posted to microsoft.public.excel.worksheet.functions
SteveG
 
Posts: n/a
Default COUNTIF problem with NOW()


Glad you got it working.

Regards,

Steve


--
SteveG
------------------------------------------------------------------------
SteveG's Profile: http://www.excelforum.com/member.php...fo&userid=7571
View this thread: http://www.excelforum.com/showthread...hreadid=555028

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
importing csv files, problem with date formats jiwolf Excel Worksheet Functions 5 March 7th 06 12:48 AM
CountIf & null values problem chris100 Excel Worksheet Functions 3 December 5th 05 12:36 PM
countif problem WYN Excel Discussion (Misc queries) 4 April 25th 05 04:28 PM
Excel Display Problem Bill Martin -- (Remove NOSPAM from address) Excel Discussion (Misc queries) 0 April 19th 05 05:25 PM
problem with countif Cowtoon Excel Worksheet Functions 5 November 10th 04 11:04 PM


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