Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
dark
 
Posts: n/a
Default CountIF and changing ranges


Hi all,

I'm working on a function that tells me how many cells there are with
"Paid" in it. The problem being, they the range will change depending
on what the date is:

I reckon i'm pretty close with this:

=COUNTIF(ADDRESS(2,C35,4)&":P2",$C$20)

Whe
C20 = Paid
C35 = 6 (Don't worry about why this is 6 - Long story, but it changes
depending on the current date)

If I use the forumla bar in excel it tells me that:
ADDRESS(2,C35,4)&":P2" = "F2:P2" Which is the problem :(
Because it's giving me "F2:P2" (with the quotes) instead of just F2:P2.
I'm 99% sure this is causing it to error and not give me a result -
because it's seeing the range as text. I don't know what else to do,
can anyone suggest anything?

Thanks in advance.


--
dark
------------------------------------------------------------------------
dark's Profile: http://www.excelforum.com/member.php...o&userid=27723
View this thread: http://www.excelforum.com/showthread...hreadid=472378

  #2   Report Post  
Biff
 
Posts: n/a
Default

Hi!

Try this:

=COUNTIF(INDIRECT(ADDRESS(2,C35)):P2,$C$20)

Biff

"dark" wrote in message
...

Hi all,

I'm working on a function that tells me how many cells there are with
"Paid" in it. The problem being, they the range will change depending
on what the date is:

I reckon i'm pretty close with this:

=COUNTIF(ADDRESS(2,C35,4)&":P2",$C$20)

Whe
C20 = Paid
C35 = 6 (Don't worry about why this is 6 - Long story, but it changes
depending on the current date)

If I use the forumla bar in excel it tells me that:
ADDRESS(2,C35,4)&":P2" = "F2:P2" Which is the problem :(
Because it's giving me "F2:P2" (with the quotes) instead of just F2:P2.
I'm 99% sure this is causing it to error and not give me a result -
because it's seeing the range as text. I don't know what else to do,
can anyone suggest anything?

Thanks in advance.


--
dark
------------------------------------------------------------------------
dark's Profile:
http://www.excelforum.com/member.php...o&userid=27723
View this thread: http://www.excelforum.com/showthread...hreadid=472378



  #3   Report Post  
Biff
 
Posts: n/a
Default

Another way:

=COUNTIF(OFFSET(A2,,C35-1):P2,C20)

Biff

"Biff" wrote in message
...
Hi!

Try this:

=COUNTIF(INDIRECT(ADDRESS(2,C35)):P2,$C$20)

Biff

"dark" wrote in message
...

Hi all,

I'm working on a function that tells me how many cells there are with
"Paid" in it. The problem being, they the range will change depending
on what the date is:

I reckon i'm pretty close with this:

=COUNTIF(ADDRESS(2,C35,4)&":P2",$C$20)

Whe
C20 = Paid
C35 = 6 (Don't worry about why this is 6 - Long story, but it changes
depending on the current date)

If I use the forumla bar in excel it tells me that:
ADDRESS(2,C35,4)&":P2" = "F2:P2" Which is the problem :(
Because it's giving me "F2:P2" (with the quotes) instead of just F2:P2.
I'm 99% sure this is causing it to error and not give me a result -
because it's seeing the range as text. I don't know what else to do,
can anyone suggest anything?

Thanks in advance.


--
dark
------------------------------------------------------------------------
dark's Profile:
http://www.excelforum.com/member.php...o&userid=27723
View this thread:
http://www.excelforum.com/showthread...hreadid=472378





  #4   Report Post  
dark
 
Posts: n/a
Default


Ah thanks heaps!
I don't understand the second way, but I do the first. That makes
sense, I thought it would be something that simple. Thanks mate.

Now my formula is complete! :P
=COUNTIF(INDIRECT(ADDRESS(2,MATCH(NOW()+CHOOSE(WEE KDAY(NOW()),5,4,3,2,1,7,6),$1:$1))):IV2,$B$20)*3


--
dark
------------------------------------------------------------------------
dark's Profile: http://www.excelforum.com/member.php...o&userid=27723
View this thread: http://www.excelforum.com/showthread...hreadid=472378

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
dynamic defined ranges Thomas Pike Excel Worksheet Functions 1 September 14th 05 12:29 AM
How do I run a filter then have my countif change? dtg_denver Excel Worksheet Functions 0 August 4th 05 04:26 PM
stop automatically changing fomula ... caryn Excel Worksheet Functions 2 June 2nd 05 04:33 PM
Countif Formula with changing criteria Stephen Excel Discussion (Misc queries) 2 May 2nd 05 07:24 AM
analysing data from alternate columns using the countif function Juniper Excel Discussion (Misc queries) 3 April 28th 05 04:12 PM


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