First off Hello You!!!!

Iexel

New Member
Joined
Apr 18, 2013
Messages
4
:)Hi.

I am new here and I thank you in advance for your support. Maybe this is simple for you and you can help me. Many blessings to you if you help me.



Select the value more approximated to the mean:


How do I write the code in VBA to calculate from a list of numerical values (which I already set) which one it is more approximated to the mean?

Is there a signal to put on after If value ... mean or Is there other way to do this?




Thank you.
 

Excel Facts

Highlight Duplicates
Home, Conditional Formatting, Highlight Cells, Duplicate records, OK to add pink formatting to any duplicates in selected range.
Suppose your raw data list in A1:A7.the following formula works for you:

Code:
=MATCH(MIN(ABS(A1:A7-AVERAGE(A1:A7))),ABS(A1:A7-AVERAGE(A1:A7)),0)

Hope it helps.
 
Upvote 0

Forum statistics

Threads
1,202,983
Messages
6,052,903
Members
444,610
Latest member
dodong

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