How to write a more efficient formula?

markusreyes2907

New Member
Joined
Jul 14, 2020
Messages
34
Office Version
  1. 2013
Platform
  1. Windows
I am just wondering if there is another method to write this formula without having to repeat so much of the formula within itself.

The formula is:
Excel Formula:
=IF(LEN(ROUND(AVERAGE(A1:A8),1))=1,ROUND(AVERAGE(A1:A8),1)&".0",ROUND(AVERAGE(A1:A8),1))&" ± "&IF(LEN(ROUND(STDEV(A1:A8),2))=3,ROUND(STDEV(A1:A8),2)&"0",ROUND(STDEV(A1:A8),2))

Essentially I want to perform a few functions in one quick go, taking an average and standard deviation and having them formatted with the proper amount of significant numbers. Without IF and LEN functions it seems that when an average rounded to 1 is a whole number it only shows up as one digit (ex. 8), but otherwise it will show up as a float (ex. 8.3). I want all numbers to appear as a float and this is the way I ended up providing that functionality. The same goes with the formatting of the standard deviation just with an extra significant number, with the exception I want to add an extra "0" at the end so it will show up as 2.20 and not 2.2 (if the hundredths is not a "0" it would show up with the extra digit [ex. 2.23]).

Thank you.
 

Excel Facts

Did you know Excel offers Filter by Selection?
Add the AutoFilter icon to the Quick Access Toolbar. Select a cell containing Apple, click AutoFilter, and you will get all rows with Apple
I think you just want:

Excel Formula:
=TEXT(ROUND(AVERAGE(A1:A8),1), "0.0")&" ± "&TEXT(ROUND(STDEV(A1:A8),2),"0.00")
 
Upvote 0
Solution

Forum statistics

Threads
1,214,667
Messages
6,120,814
Members
448,990
Latest member
rohitsomani

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