Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
mpierre
 
Posts: n/a
Default using content of a cell in a formula in another cell

I am trying to use the value on one cell to form the range part an a countif
formula in another cell like this:
=COUNTIF(Actions!I2:I&"C2","*all*")

where C2 is the cell in the current worksheet whose contents (currently 20)
I want to use. The contents will change periodically. The formula that I
want evaluated would look like:
=COUNTIF(Actions!I2:I20,"*all*")

Anyone have a suggestion, please?
  #2   Report Post  
Jason Morin
 
Posts: n/a
Default

=COUNTIF(INDIRECT("Actions!I2:I"&C2),"*all*")

or

=COUNTIF(OFFSET(I2,,,C2-1),"*all*")

HTH
Jason
Atlanta, GA

-----Original Message-----
I am trying to use the value on one cell to form the

range part an a countif
formula in another cell like this:
=COUNTIF(Actions!I2:I&"C2","*all*")

where C2 is the cell in the current worksheet whose

contents (currently 20)
I want to use. The contents will change periodically.

The formula that I
want evaluated would look like:
=COUNTIF(Actions!I2:I20,"*all*")

Anyone have a suggestion, please?
.

  #3   Report Post  
Peo Sjoblom
 
Posts: n/a
Default

A couple of ways

=COUNTIF(OFFSET(Actions!$I$2,,,C2+1,),"*all*")

=COUNTIF(INDEX(Actions!I2:I10000,):INDEX(Actions!I 2:I10000,C2),"*all*")

the latter is not volatile although a bit longer, it can also be written as

=COUNTIF(INDEX(Actions!I:I,2):INDEX(Actions!I:I,C2 +2),"*all*")

where the 2 and +2 indicates the range starts in row 2 of column I

Regards,

Peo Sjoblom

"mpierre" wrote:

I am trying to use the value on one cell to form the range part an a countif
formula in another cell like this:
=COUNTIF(Actions!I2:I&"C2","*all*")

where C2 is the cell in the current worksheet whose contents (currently 20)
I want to use. The contents will change periodically. The formula that I
want evaluated would look like:
=COUNTIF(Actions!I2:I20,"*all*")

Anyone have a suggestion, please?

  #4   Report Post  
mpierre
 
Posts: n/a
Default

Jason, Peo:
All your suggestions work great. Thank you!!

"Jason Morin" wrote:

=COUNTIF(INDIRECT("Actions!I2:I"&C2),"*all*")

or

=COUNTIF(OFFSET(I2,,,C2-1),"*all*")

HTH
Jason
Atlanta, GA

-----Original Message-----
I am trying to use the value on one cell to form the

range part an a countif
formula in another cell like this:
=COUNTIF(Actions!I2:I&"C2","*all*")

where C2 is the cell in the current worksheet whose

contents (currently 20)
I want to use. The contents will change periodically.

The formula that I
want evaluated would look like:
=COUNTIF(Actions!I2:I20,"*all*")

Anyone have a suggestion, please?
.


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
inserting data from a row to a cell, when the row number is specified by a formula in a cell [email protected] New Users to Excel 2 January 6th 05 07:18 AM
Formula Result Correct but value in the cell is wrong jac Excel Worksheet Functions 2 December 17th 04 08:05 PM
How can I write an if-then formula for 0 or less than 0 in cell t. Baz1 Excel Worksheet Functions 1 November 30th 04 04:33 PM
GET.CELL Biff Excel Worksheet Functions 2 November 24th 04 07:16 PM
Cell doesn't show formula result - it shows formula (CTRL + ' doe. o0o0o0o Excel Worksheet Functions 6 November 19th 04 03:13 PM


All times are GMT +1. The time now is 07:32 AM.

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"