Formula to locate and remove outlying values from a large data set

placidbomb

New Member
Joined
Sep 9, 2024
Messages
2
Office Version
  1. 365
Platform
  1. MacOS
Hi guys,

Am relatively new to excel and although I do have some experience with using formula, this is a scenario that I can't seem to be able to crack. I have a set of data, where I need to identify and remove outlying values from the data set. These outlying values are usually too small or too big causing the average to skew by a lot. I am trying to avoid that. In the attached sample data sheet I have manually selected the values (highlighted in blue) that I want to remove in real life scenario. But I would like to know how I can remove those outlying values if the data set was very large. In real scenario, I won't have the time or the accuracy to locate these outlying values one by one since I will have hundreds of columns. Also not required, but it would be helpful if there was a way to close the empty cell gaps, once those outlying values have been deleted. Thank you very much.
 

Attachments

  • Screenshot 2024-09-09 at 1.13.32 PM.png
    Screenshot 2024-09-09 at 1.13.32 PM.png
    204.4 KB · Views: 12

Excel Facts

Which lookup functions find a value equal or greater than the lookup value?
MATCH uses -1 to find larger value (lookup table must be sorted ZA). XLOOKUP uses 1 to find values greater and does not need to be sorted.
Hello, here is an option where you need to pick a range and set lower (50 at the moment) and upper (200 at the moment) bounds:

Excel Formula:
=LET(
a,A1:V100,
lower,50,
upper,200,
b,IF((a="")+(a>upper)+(a<lower)=0,a,""),
IFNA(DROP(REDUCE("",SEQUENCE(COLUMNS(a)),LAMBDA(x,y,HSTACK(x,FILTER(CHOOSECOLS(b,y),CHOOSECOLS(b,y)<>"")))),,1),""))

No idea how it will perform on a larger set of data but you could test it (are there any empty columns within the data?)...
 
Upvote 0
Hi Sofia. Thanks. So is this formula for one single column? Also to answer your question, no there won't be any empty columns within the data.
 
Upvote 0
Hi Sofia. Thanks. So is this formula for one single column? Also to answer your question, no there won't be any empty columns within the data.

It could be used for one single column but you could also select multiple columns as in the example above, i.e. the A1:V100 range.
 
Upvote 0

Forum statistics

Threads
1,224,817
Messages
6,181,149
Members
453,021
Latest member
Justyna P

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