Formula requested to determine an average of multiple values entered in a single cell

TheEngineer

New Member
Joined
Aug 26, 2012
Messages
1
I need a formula that will calculate the average from a list of numbers in a single cell. These numbers are entered as individual percent values, and separated by commas. An example would be:

A1 = [55%, 60%, 7%, 92%]

For the above example list, the formula I require would spit out 54% (rounded).

I am running Excel 03.

I found a similar problem in a previous thread, but I couldn't modify the solution formula for 2 digit numbers (from 1 digit).

Thanks for sharing your knowledge,
JN
 

Excel Facts

Copy formula down without changing references
If you have =SUM(F2:F49) in F50; type Alt+' in F51 to copy =SUM(F2:F49) to F51, leaving the formula in edit mode. Change SUM to COUNT.
I need a formula that will calculate the average from a list of numbers in a single cell. These numbers are entered as individual percent values, and separated by commas. An example would be:

A1 = [55%, 60%, 7%, 92%]

For the above example list, the formula I require would spit out 54% (rounded).

I am running Excel 03.

I found a similar problem in a previous thread, but I couldn't modify the solution formula for 2 digit numbers (from 1 digit).

Thanks for sharing your knowledge,
JN
Here's a UDF if you don't mind enabling macros.
Code:
Function AvgValuesInCell(R As Range)
Dim vA As Variant, S As Double

If R.Cells.Count = 1 Then
    vA = Split(R.Value, ", ")
    For i = LBound(vA) To UBound(vA)
        S = S + Val(vA(i))
    Next i
    AvgValuesInCell = Format((S / 100 / (UBound(vA) - LBound(vA) + 1)), "0%")
End If
End Function
After you install it, use it like this in say cell B1:
Code:
=AvgValuesInCell(A1)
 
Upvote 0
Hi

My take on this with formula:
=AVERAGE(LEFT(A1,FIND("%",A1,1)-1)+0,MID(A1,FIND("%",A1,1)+3,(FIND("zzz",SUBSTITUTE(A1,"%","zzz",2),1))-(FIND("%",A1,1)+3)),MID(A1,FIND("zzz",SUBSTITUTE(A1,",","zzz",2),1)+2,(FIND("zzz",SUBSTITUTE(A1,"%","zzz",3),1))-(FIND("zzz",SUBSTITUTE(A1,",","zzz",2),1)+2)+0),MID(A1,FIND("zzz",SUBSTITUTE(A1,",","zzz",3),1)+2,(FIND("zzz",SUBSTITUTE(A1,"%","zzz",4),1))-(FIND("zzz",SUBSTITUTE(A1,",","zzz",3),1)+2)+0))
Cell A1 contains the values.

Vidar
 
Upvote 0
I need a formula that will calculate the average from a list of numbers in a single cell. These numbers are entered as individual percent values, and separated by commas. An example would be:

A1 = [55%, 60%, 7%, 92%]

For the above example list, the formula I require would spit out 54% (rounded).

I am running Excel 03.

I found a similar problem in a previous thread, but I couldn't modify the solution formula for 2 digit numbers (from 1 digit).

Thanks for sharing your knowledge,
JN

A generic set up...

Add the following code for EVAL by Charles Williams to your workbook, using Alt+F11...

Public Function EVAL(theInput As Variant) As Variant
'
' if UDF evaluate the input string as though it was on this sheet
' else evaluate for activesheet
'
Dim vEval As Variant
Application.Volatile
On Error GoTo funcfail
If Not IsEmpty(theInput) Then
If TypeOf Application.Caller.Parent Is Worksheet Then
vEval = Application.Caller.Parent.Evaluate(CStr(theInput))
Else
vEval = Application.Evaluate(CStr(theInput))
End If
If IsError(vEval) Then
EVAL = CVErr(xlErrValue)
Else
EVAL = vEval
End If
End If
Exit Function
funcfail:
EVAL = CVErr(xlErrNA)
End Function

If A1 can house:

55%, 60%, 7%, 92%

Run in B1...

=AVERAGE(eval("{"&SUBSTITUTE(A1,"%","")&"}"))/100

If you use decimals (representing percentages) in A1, that is:

0.55,0.6,0.07,0.92

Run in B1 instead...

=AVERAGE(eval("{"&A2&"}"))

Note that comma is used as list separator.
 
Upvote 0
I need a formula that will calculate the average from a list of numbers in a single cell. These numbers are entered as individual percent values, and separated by commas. An example would be:

A1 = [55%, 60%, 7%, 92%]

For the above example list, the formula I require would spit out 54% (rounded).

I am running Excel 03.

I found a similar problem in a previous thread, but I couldn't modify the solution formula for 2 digit numbers (from 1 digit).

Thanks for sharing your knowledge,
JN
Does the cell contain the brackets [ ] ?

Will there always be only 4 numbers?

Will the maximum number be 100%?

It would be a good idea to post SEVERAL representative samples of the data.
 
Upvote 0

Forum statistics

Threads
1,215,045
Messages
6,122,840
Members
449,096
Latest member
Erald

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