# Solved: Calculate an average

Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

#### Guest2

In excel I would like to calculate the value of Column A (\$) / Column B(# of years) across the row, one result per column for each number of years.

Any suggestions would be greatly appreciated

Example:

7 \$2,800 \$400 \$400 \$400 \$400 \$400 \$400 \$400
5 \$364 \$73 \$73 \$73 \$73 \$73
3 \$150 \$50 \$50 \$50
2 \$200 \$100 \$100
3 \$250 \$83 \$83 \$83
2 \$210 \$105 \$105
2 \$210 \$105 \$105
2 \$200 \$100 \$100
2 \$100 \$50 \$50
1 \$140 \$140

#### Ent

Josiah
The ideal way would probably be to use macros. However if you put this in every box that may hold the results (i.e. every box with a 400 in your first example, for the maximum number of columns you'll have years) it should work

Code:
=IF(COLUMN()-2<=A1,B1/A1,"")

#### Guest2

That works for our needs - thanks for your time

Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

As Seen On