# Cell Reference as a variable?

#### placeholder

##### New Member

I am working in Excel doing some Software Validation *yawn*. Having to prove each stage of someone elses software for auditing purposes.

What I want to know is;

In A is a long list of numbers,
In B is the formula '=Count(A1:A5)'
and in C1 + C2 are variable numbers.

What I want to happen is this, the numbers in row C change the row number in the equation in B. So if C1 = 75 and C2=85 then B1= '=count(A75:85)', if C1=23 and C2=145 then B1= 'Count(A23:A145)'.

Please tell me this is possible

### Excel Facts

Select range. Press Ctrl+1. On Number tab, choose Custom. Type Alt+7 then space then @ sign (using 7 on numeric keypad)

#### Andrew Poulsom

##### MrExcel MVP
Try:

=COUNT(INDIRECT("A"&C1&":A"&C2))

#### erik.van.geit

##### MrExcel MVP
Hello, placeholder
Welcome to the Board !!!!!
take a look at the function INDIRECT

B1= Count(INDIRECT("A" & C1 & ":A" & C2))

kind regards,
Erik

#### scottishstu

##### New Member

Where C1 & C2 are your variables? and 1 is col no 1 i.e. "A"

See if this helps you any??

#### placeholder

##### New Member
omg I love you guys *heart*

Saved me about 8-9 hours of work

Happy Christmas!!

Replies
8
Views
142
Replies
8
Views
90
Replies
8
Views
129
Replies
3
Views
170
Replies
1
Views
56