replacing missing values with an average: soduku?

knightta2

New Member
Joined
Feb 25, 2011
Messages
2
Hi guys, if you can help me with this it will same me many hours, I'm pretty sure a formula or macro can do this, but I don't have the expertise to write one. Any help would be great.

Problem:

I have a list of Standard Industrial Codes (SIC) for businesses and employment against these codes.

2 digit SIC is eg 20
3 digit SIC represents more detailed subdivisions eg
201
202
203
etc

At '2 digit SIC' all the data are available, but at 'SIC 3 digit' some data are starred out as would identify businesses. Ie disclosure control has been applied to the data.

What I want to do is replace the starred out data with a best guess.

For example the table below shows SIC 2 digit between 17 and 22 and employment on the rhs column.

Taking the 2 digit code 20 we see total employment is 1630, but a number of 3 digit SIC codes below are stared out - 203,205 and 206. But we know together they make 1630 - (310+0+154)=1166

So I'd like to replace the starred out values in 203,205 and 206 with an average value of 1166/3 =389

I'd like to do this for all 3 digit SICs as in the example below - in reality I have a much longer list - is there a macro or formula which could do this. It would have to take the difference between the 2 digit SIC total and the total of the 2 digit SICs and apportion this to the starred out 3 digit SIC codes.

17 1530
18 1740
19 44
20 1630
21 1571
22 6135
171 *
172 *
181 1740
182 0
191 0
192 44
201 310
202 0
203 *
204 154
205 *
206 *
211 *
212 *
221 1341
222 4794
 

Excel Facts

Links? Where??
If Excel says you have links but you can't find them, go to Formulas, Name Manager. Look for old links to dead workbooks & delete.
Excel Workbook
ABC
1171530
2181740
31944
4201630
5211571
6226135Estimated
7171*765
8172*765
91811740
101820
111910
1219244
13201310
142020
15203*389
16204154
17205*389
18206*389
19211*786
20212*786
212211341
222224794
Sheet
 
Upvote 0
Just to say thanks very much this works a treat and is a great method for assigning best guess data to missing values by apportioning down.

Something I'll use a lot (I'm a Statistician who deals with business data).

All the best, Tom.
 
Upvote 0

Forum statistics

Threads
1,224,522
Messages
6,179,299
Members
452,904
Latest member
CodeMasterX

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