How to change a formula reference?

G

Guest

I need to create a formula that references a range of cells. The range is
supposed to be determined by what the user enters into another cell. Can a
formula have a variable in it that will grab a number from another cell?
For instance:
=COUNTIF(N[B18]:N[B18+B18],"Y")?
Where you see B18 the user has entered in a number, we will say it was 5. I
need the function to reference the cells in the N column from N5 (cell B18
has a 5 in it) to N10 (B18+B18 or 5+5).

I appreciate any help you all can give me. Thanks so much in advance.

Brockettb
 
B

Biff

Hi!

Assume you enter in cells:

A1 = 5
B1 = 10

=COUNTIF(INDIRECT("N"&A1&":N"&B1),"Y")

Which translates to:

=COUNTIF(N5:N10,"Y")

Biff

---Original Message-----
 
D

David McRitchie

Hi Buck,
Use the INDIRECT Worksheet Function

=COUNTIF(INDIRECT("N"&B18 &":N" &B18+B18),"Y")
 
G

Guest

Thank you so much every one. I am going to try these out and see which one
works the best for me. Thanks again for the help.

Brockettb

Myrna Larson said:
Another way:

=OFFSET($N$1,B18-1,0,B18*2,1)


I need to create a formula that references a range of cells. The range is
supposed to be determined by what the user enters into another cell. Can a
formula have a variable in it that will grab a number from another cell?
For instance:
=COUNTIF(N[B18]:N[B18+B18],"Y")?
Where you see B18 the user has entered in a number, we will say it was 5. I
need the function to reference the cells in the N column from N5 (cell B18
has a 5 in it) to N10 (B18+B18 or 5+5).

I appreciate any help you all can give me. Thanks so much in advance.

Brockettb
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top