Is there a way to represent a number many times inside of a function, without typing it in the same number of times in a table?

J Blizzard

New Member
Joined
Dec 23, 2019
Messages
20
Office Version
  1. 365
Platform
  1. Windows
I'm inputting values into a spreadsheet from a printed report. If there are 18 storage units, 15 of them rent for $60, and the remaining units rent for a few different values, is there a way to avoid the following method AND avoid entering everything on my printed report (dozens of pages) into a table to do a weighted average?

Formula: =AVERAGE(60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,43,80,200)


I'm looking for some way to represent the "60" value multiple times in the string, like a While Loop or similar. Contextually it would look like the following, but obviously that isn't sufficient:

Formula: =AVERAGE((60*15),43,80,200)
 

Excel Facts

Who is Mr Spreadsheet?
Author John Walkenbach was Mr Spreadsheet until his retirement in June 2019.
Why would you be writing the numbers in your formula directly?
Usually, you would reference a range of cells, that hold those values!

However, if you are going to write the numbers directly into the formulas, create a manual AVERAGE formula. The AVERAGE is just the sum of all the value divided by the number of the values, i.e.
Excel Formula:
=SUM((60*15),43,80,200)/(15+3)
 
Upvote 0
Another option is
Excel Formula:
=AVERAGE(SEQUENCE(,15,60,0),43,80,200)
 
Upvote 1
Solution
Average and sequence looks like a working step for my use! I was hoping for like, average(weight(60,15),43,80,200) or something intuitively similar. This is very close and I'll be using it. Thank you! The reason for writing numbers into the formula directly is to avoid typing in dozens of sheets of paper. It's already mind numbing.
 
Upvote 0
Glad we could help & thanks for the feedback.
 
Upvote 0
Glad you found a solution that works for you.

The reason for writing numbers into the formula directly is to avoid typing in dozens of sheets of paper. It's already mind numbing.
One advantage to typing them in was if you had 15 occurrences of a number, you would only need to type it once, and then you could copy/paste/drag down for the other 14.
And you could have a reusable form where you only have to enter the formulas once, and just enter numbers to change things.
But use whatever suits your needs the best!
 
Upvote 0

Forum statistics

Threads
1,220,965
Messages
6,157,119
Members
451,398
Latest member
rjsteward

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.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

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

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

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
Back
Top