How to split cell value into multiple bands using array formula?

nkasic

New Member
Joined
Aug 11, 2015
Messages
15
I have price list i.e. discounts based on length in meters, and it looks like this:
Length more than metersDiscount (%)
0​
15%​
4​
55%​
8​
71,53%​
16​
55%​
32​
0%​

It's defined in pricelist and it't the same for each service.
However, discounts are applied in a way that first 4m discount is 15%. For the length after 4m, but before 8m discount is 55% etc.
That means, e.g. if I have length of 11,5m, there will be discount on price per meter of 15% for 4m (from 0 to 4m), discount of 55% for 4m (from 4m to 8m) and discount of 71,53% for 3,5m (from 8m to 11,5m).
For that purpose I need to split length into bands i.e. to determine length in each band in order to apply appropriate discount.
That is not a problem if I have just a single value as I can use a helper table and various standard formulas (IF, MAX etc9
However, this is part of large specification where there are a number of such items, so I need to develop formula which will result in an array of values, each representing length in each band.
E.g. if I have lenght of 57,731 I need a formula that will result in an array:


4​
4​
8​
16​
25,731​

i.e. resulting array should be: 4;4;8;16;25,731. That's how length of 57,731m is divided into bands according to the first table, and I already created array formulas that can use that array and multiply it with array of discounts and apply them and generate final, single value (price).
Simplified, my specification looks like this:
length (m)Serviceprice per meter (€)discount (%)Total price
11,5Service 11500,461178261
57,731Service 2300,300053697320331
123,123Service 166,7xxx
456,456Service 328,5xxx
12,13Service 413,4xxx
15,123Service 1121,55xxx
22,333Service 335,4xxxx

There are hundreds of rows, so I cannot use helper table for each row, but I need an array formula that I will use for calculating compound discount and final result (Total price) in each row.
Any idea?
Couldn't find anything similar on internet.
 
so I cannot use helper tables
Why not? The helper table is very small and is simply referenced in the same formula for each row of your data. It's not one helper table per row!
 
Upvote 0

Excel Facts

How to change case of text in Excel?
Use =UPPER() for upper case, =LOWER() for lower case, and =PROPER() for proper case. PROPER won't capitalize second c in Mccartney

Forum statistics

Threads
1,221,310
Messages
6,159,173
Members
451,543
Latest member
cesymcox

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