Excel Problem Help Required

purceld2

Well-known Member
Joined
Aug 18, 2005
Messages
586
Office Version
  1. 2013
Platform
  1. Windows
I have a spreadsheet which contains information of all the advertisement panels/sites that we have with a 10 mile proximity of our customers stores/dealerships. The list contains over 2000 sites but covering 74 of the customers 79 stores. My problem is that the customer only has enough budgets to purchase 280 panels.

Issue is that he wants as many of his store covered as possible. I have attached a pivoit table which provide detail of the amount of panels covering each of the customers sites/dealerships.


Other than manually going through and selecting panels/sites, is they a way of sweeping through the list picking 1 from each dealership until the desired total has been reached 280.

This is something I do quite regularly and wondered if a bit of VB code could do the trick.

Any help would be most appreciated.



Excel 2010
AB
3Row LabelsCount of Customer Venue Name
4Bell Truck & Van (Billingham)5
5Bell Truck & Van (Longbenton)22
6Bell Truck & Van (Stockton)5
7Caledonian Truck & Van6
8Ciceley Commercials Blackburn16
9Ciceley Commercials Carlisle7
10Ciceley Truck & Van Centre28
11Enza Motors Stoke17
12Enza Motors Trafford Park53
13Enza Motors Warrington28
14Euro Commercials Cardiff10
15Euro Commercials Ltd8
16Euro Commercials Swansea7
17Hughes of Aylesbury11
18Intercounty Truck and Van (Boston)4
19Intercounty Truck and Van (Lincoln)2
20Intercounty Truck and Van (Milton Keynes)19
21Intercounty Truck and Van (Peterborough)13
22Intercounty Truck and Van Limited12
23John R Weir Perth3
24Mercedes-Benz Brentford148
25Mercedes-Benz City West Commercials (Avonmouth)17
26Mercedes-Benz City West Commercials (Bristol)15
27Mercedes-Benz City West Commercials (St. Austell)2
28Mercedes-Benz Colindale131
29Mercedes-Benz Commercial Vehicles Aberdeen11
30Mercedes-Benz Croydon122
31Mercedes-Benz of Weston-super-Mare2
32Mercedes-Benz Retail Used Cars East London100
33Mertrux Limited (Derby)16
34Mertrux Limited (Leicester)21
35Mertrux Limited (Nottingham)21
36Midlands Truck & Van (Birmingham)106
37Midlands Truck & Van (Coventry)20
38Midlands Truck & Van (Wolverhampton)36
39Northside Truck & Van Ltd (Bradford)20
40Northside Truck & Van Ltd (Doncaster)11
41Northside Truck & Van Ltd (Hull)5
42Northside Truck & Van Ltd (Immingham)4
43Northside Truck & Van Ltd (Leeds)30
44Northside Truck & Van Ltd (Sheffield)17
45Northside Truck & Van Ltd (York)4
46Orwell Truck and Van - Colchester11
47Orwell Truck and Van - Ipswich8
48Orwell Truck and Van - Newmarket7
49Orwell Truck and Van - Norwich9
50Pentagon Andover9
51Pentagon Fareham24
52Pentagon Poole18
53Road Range Commercials (Deeside)22
54Road Range Commercials (Liverpool)32
55Road Range Commercials (North Wales)3
56Road Range Van Centre Liverpool30
57Rossetts Commercials Aldershot37
58Rossetts Commercials Crawley30
59Rossetts Commercials Eastbourne9
60Rossetts Commercials Worthing17
61Rygor Commercials Heathrow109
62Rygor Commercials Kidderminster14
63Rygor Commercials Oxford15
64Rygor Commercials Reading27
65Rygor Commercials Swindon15
66Rygor Commercials Tewkesbury8
67Rygor Commercials Westbury7
68Rygor Newbury9
69S & B Commercials Hatfield51
70S & B Commercials Stansted11
71S & B Commercials West Thurrock59
72S G Smith (Motors) Sydenham Ltd129
73Sparshatts of Kent (Dartford)74
74Sparshatts of Kent Ltd (Sittingbourne)9
75Western Commercial Bellshill35
76Western Commercial Edinburgh26
77Western Commercial Glasgow43
Sheet3
 

Excel Facts

Select all contiguous cells
Pressing Ctrl+* (asterisk) will select the "current region" - all contiguous cells in all directions.
Hi,

try this:

1. Sort your data so that the list runs from those with the fewest boards at the top to the highest at the bottom.
2. In cell D1 insert the number of boards the customer can pay for, in this case 280.
3. In cell C2: =IF(B2 < D1/COUNTA(B2:$B$75), B2, INT(D1/COUNTA(B2:$B$75) ) )<d1 COUNTA(B2:$B$75)))<="" COUNTA(B2:$B$75),B2,INT(D1="" strong="">
</d1>
<d1 COUNTA(B2:$B$75)))<="" COUNTA(B2:$B$75),B2,INT(D1="" strong="">4. In cell D</d1><d1 COUNTA(B2:$B$75)))<="" COUNTA(B2:$B$75),B2,INT(D1="" strong="">2: </d1><d1 COUNTA(B2:$B$75)))<="" COUNTA(B2:$B$75),B2,INT(D1="" strong="">=D1-C2
</d1>
<d1 COUNTA(B2:$B$75)))<="" COUNTA(B2:$B$75),B2,INT(D1="" strong="">5.</d1><d1 COUNTA(B2:$B$75)))<="" COUNTA(B2:$B$75),B2,INT(D1="" strong=""> Select cells C2 & D2 and copy down the list.

The result will be as even a number of boards around each location as possible, but taking account of the sometimes limited numbers of boards available.

Hope this helps.

PS. Not really an Excel matter, but it might be better to consider a more targetted strategy of allocation than my solution will provide. For example if there are many boards available in an area does the customer want to have more so that his proportional presence is greater. For example give the data and my calculations in all those locations with 3 or less boards every board (100%) will present your client, but in Mercedes-Benz Brentford there will only be 4 boards or only a little over 2%.</d1><d1 COUNTA(B2:$B$75)))<="" COUNTA(B2:$B$75),B2,INT(D1="" strong=""></d1>
 
Upvote 0
An alternative equation would be, in C2: =MAX(1,INT(B2*D1/SUM(B2:$B$75)+0.5)) and copy down.

This will give you a much more even (percentage wise) coverage. Its still far from perfect because of the impact of some areas having significantly lower numbers of boards available.

Just a thought.
 
Upvote 0
Hi Purcel, grateful if you could let me know whether this was useful?

Regards
 
Upvote 0
My apologies for being so rude and not providing some feedback

It looks like I did not explain the problem correctly so I did not understand you solution. But I will tell you what I did to resolve the problem I had and you may be able to suggest a better solution.

I sorted the data by Dealer name then

proximity to our customer’s screens. I then performed a advance filter on the data using the dealer names as the criteria with unique option ticked.

The result was that I got the nearest screen to each dealership

I cut this data to a new Spreadsheet and repeated the process getting then next nearest for each dealership.

I repeated the process until I had hit my target of 280 screens I did for sweeps.

Regarding the "targeted strategy of allocation" this was not necessary as each dealership contributed to the cost equally.

Thank you for your time looking into my issue. Sorry again I did not provide any feedback.

Regards

Desmond
 
Upvote 0
thanks for letting me know. As a point for the future it is worth remembering that Forum users probably don't understand the jargon that we all use in our day to day business. That is probably the route of the original confusion. But glad that you've now resolved the problem.

Regards
 
Upvote 0

Forum statistics

Threads
1,215,459
Messages
6,124,948
Members
449,198
Latest member
MhammadishaqKhan

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