Formula to identify outliers between the values in multiple cells

mafallaize

New Member
Joined
Aug 23, 2011
Messages
31
Hi guys,

Cell B1 contains the number of assessments, which can change from 1 to 10.
The table counts the number of assessments with each result, either "VH","H","M" or "L". For the example below, there are 4 assessments.
I'm looking for a formula for column G which can be copied down:
  • Returns "No" if all assessments are of one type (VH, H, M, L) e.g. 0004 or 0400
  • Returns "Yes" if the assessments occupy 2 adjacent types e.g. 0022 or 0220
  • Returns "Big" if the assessments occupy 3 or 4 types or 2 non-adjacent types e.g 0111,1110, 3001 or 2002
In other words, if the rating between assessments is wildly different, we identify it with Big. If it is slightly different, "Yes" or if the same for each then "No"

Here's an example table:

Number of Assessments:4
VHHMLN/AOutlier
00400No
00220Yes
40000No
00400No
00310Yes
04000No
10003No
00112Yes
00301No
01201Yes
03010Big

I appreciate your assistance, thanks!
 

Excel Facts

What is the shortcut key for Format Selection?
Ctrl+1 (the number one) will open the Format dialog for whatever is selected.
MrExcelPlayground13.xlsx
ABCDEFG
1VHHMLN/AOutlier
200400NoNo
300220YesYes
440000NoNo
500400NoNo
600310YesYes
704000NoNo
810003NoNo
900112YesYes
1000301NoNo
1101201YesYes
1203010BigBig
Sheet18
Cell Formulas
RangeFormula
G2:G12G2=CHOOSE(INT(LOG10(VALUE(RIGHT(VALUE(A2&B2&C2&D2)/10000,LEN(VALUE(A2&B2&C2&D2)/10000)-2)))+1),"No","Yes","Big")



Here it is with all the helper columns expanded to understand it better:
MrExcelPlayground13.xlsx
ABCDEFGHIJKL
1VHHMLN/AOutlier
200400NoNo400.00441No
300220YesYes220.0022222Yes
440000NoNo40000.441No
500400NoNo400.00441No
600310YesYes310.0031312Yes
704000NoNo4000.0441No
810003NoNo10000.111No
900112YesYes110.0011112Yes
1000301NoNo300.00331No
1101201YesYes1200.012122Yes
1203010BigBig3010.03013013Big
Sheet18
Cell Formulas
RangeFormula
G2:G12G2=CHOOSE(INT(LOG10(VALUE(RIGHT(VALUE(A2&B2&C2&D2)/10000,LEN(VALUE(A2&B2&C2&D2)/10000)-2)))+1),"No","Yes","Big")
H2:H12H2=VALUE(A2&B2&C2&D2)
I2:I12I2=H2/10000
J2:J12J2=VALUE(RIGHT(I2,LEN(I2)-2))
K2:K12K2=INT(LOG10(J2)+1)
L2:L12L2=CHOOSE(K2,"No","Yes","Big")
 
Upvote 0
This is better. That last one didn't take the widest split.
MrExcelPlayground13.xlsx
ABCDEFGHIJKL
1VHHMLN/AOutlier
200400NoNo400.00441No
300220YesYes220.0022222Yes
440000NoNo40000.441No
500400NoNo400.00441No
600310YesYes310.0031312Yes
704000NoNo4000.0441No
810003NoNo10000.111No
900112YesYes110.0011112Yes
1000301NoNo300.00331No
1101201YesYes1200.012122Yes
1213010BigBig13010.130113014Big
Sheet18
Cell Formulas
RangeFormula
G2:G12G2=CHOOSE(INT(LOG10(VALUE(RIGHT(VALUE(A2&B2&C2&D2)/10000,LEN(VALUE(A2&B2&C2&D2)/10000)-2)))+1),"No","Yes","Big","Big")
H2:H12H2=VALUE(A2&B2&C2&D2)
I2:I12I2=H2/10000
J2:J12J2=VALUE(RIGHT(I2,LEN(I2)-2))
K2:K12K2=INT(LOG10(J2)+1)
L2:L12L2=CHOOSE(K2,"No","Yes","Big","Big")
 
Upvote 0
This is better. That last one didn't take the widest split.
MrExcelPlayground13.xlsx
ABCDEFGHIJKL
1VHHMLN/AOutlier
200400NoNo400.00441No
300220YesYes220.0022222Yes
440000NoNo40000.441No
500400NoNo400.00441No
600310YesYes310.0031312Yes
704000NoNo4000.0441No
810003NoNo10000.111No
900112YesYes110.0011112Yes
1000301NoNo300.00331No
1101201YesYes1200.012122Yes
1213010BigBig13010.130113014Big
Sheet18
Cell Formulas
RangeFormula
G2:G12G2=CHOOSE(INT(LOG10(VALUE(RIGHT(VALUE(A2&B2&C2&D2)/10000,LEN(VALUE(A2&B2&C2&D2)/10000)-2)))+1),"No","Yes","Big","Big")
H2:H12H2=VALUE(A2&B2&C2&D2)
I2:I12I2=H2/10000
J2:J12J2=VALUE(RIGHT(I2,LEN(I2)-2))
K2:K12K2=INT(LOG10(J2)+1)
L2:L12L2=CHOOSE(K2,"No","Yes","Big","Big")
Wow that was quick! I wrapped it in an iferror to capture quad zeros, works like a charm! Thank you very much James, clever stuff XD.
 
Upvote 0

Forum statistics

Threads
1,215,133
Messages
6,123,233
Members
449,092
Latest member
SCleaveland

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