# Calculation based on existing column, don't know range

#### RoccoM

##### New Member
Need help with the following:
I have a height and width column in pixel count. I convert the pixels to inches without a problem.
How do I figure out the last row in the column. They amount of rows will change every time I pull my data. In other words, how can I create my calculation for each row, when I do not know how many rows my data will contain?

 A B C D 1 Height in Pixels Width in Pixels Height in Inches Width in Inches 2 400 200 =a2/40*1.75 =b2/40*175

<tbody>
</tbody>

3
4
5
6
etc...

Thanks for the help
Rocco

### Excel Facts

How to change case of text in Excel?
Use =UPPER() for upper case, =LOWER() for lower case, and =PROPER() for proper case. PROPER won't capitalize second c in Mccartney

#### jondavis1987

##### Active Member
I think if you format it as a table, You can just use the formula to expand the range of the table so if your range keeps changing your formulas will account for it

#### jondavis1987

##### Active Member
Yeah, if you convert your range into a table with headers, if you enter the formula into Height in inches and the other one in height to formula, it will automatically calculate what you're trying to do for each row.

<colgroup><col><col><col><col><col span="5"></colgroup><tbody>
Code:
``````[TR]
[TD]Height in Pixels[/TD]
[TD]Width in Pixels[/TD]
[TD]Height in Inches[/TD]
[TD]Width in Inches[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]400[/TD]
[TD]200[/TD]
[TD]17.5[/TD]
[TD]875[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD] [/TD]
[/TR]
[TR]
[TD]200[/TD]
[TD]50[/TD]
[TD]8.75[/TD]
[TD]218.75[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]600[/TD]
[TD]300[/TD]
[TD]26.25[/TD]
[TD]1312.5[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]600[/TD]
[TD]200[/TD]
[TD]26.25[/TD]
[TD]875[/TD]``````
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>

#### RoccoM

##### New Member
Thanks for the reply. It's a great option. I got impatient. Before I saw the responses to my post, I just put in code to count the rows in column A. (never blank rows in the data). Then I stored the result in a variable. Using the range command, I can successfully enter the range (variable). I got this from another post in this forum.

Thanks for the help! I will try to format as a table also. I like this idea!
Rocco

Replies
1
Views
129
Replies
3
Views
81
Replies
3
Views
202
Replies
5
Views
552
Replies
0
Views
535

1,136,968
Messages
5,678,872
Members
419,787
Latest member
juanam

### We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.

### Which adblocker are you using?

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

### Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

### Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back