How to automatically update discount based on date

okvals48

New Member
Joined
Sep 27, 2020
Messages
15
Office Version
  1. 365
Platform
  1. Windows
Hi,

i would like to update discount values automatically in my table based on the date in my master data table.
So for example i have a table where i have discounts but this discounts are only valid for certain period of time, after that end date i enter new discounts and i would like that new discounts are applied from the new date, but i also need that old ones do get affected by my change.


1605271561058.png


Thank you for your help
 

Excel Facts

Quick Sum
Select a range of cells. The total appears in bottom right of Excel screen. Right-click total to add Max, Min, Count, Average.
in customer 1 you have a discount valid until 14th May of 2% , BUT customer 1 also has a discount of 2.2% on 1st April, so there is an overlap
 
Upvote 0
Assuming NO overlap in dates for same customer

I think this should work, if it finds a valid date it will return the discount or error will be 0%
=IFERROR(LOOKUP(1E+307,1/((C3=I:I)*(D3>=J:J)*(C3<=K:K))*L:L),0)

But where you have blank cells they may be seen as 1/1/1900 - so it maybe worth adding a future date and then changing when you stop the promotion with the date the promotion stops
OR add today() - so it sees today as part of the end date and change that when reach the end date

lookup ID value and date between range of dates.xlsx
ABCDEFGHI
1CustomerDate purchasedRebate DueCustomerStartEndPercent
237/10/160.0%15/1/165/11/161%
347/11/160.0%11/1/171/11/172%
457/12/160.0%26/1/166/11/163%
5610/10/1611.0%22/1/172/11/174%
6710/8/160.0%37/1/167/9/165%
7812/8/1615.0%33/1/173/11/176%
893/6/1718.0%48/1/168/11/167%
991/6/1717.0%44/1/174/11/178%
1059/1/169/11/169%
1155/1/175/11/1710%
12610/1/1610/11/1611%
1366/1/176/11/1712%
14711/1/1611/11/1613%
1571/1/171/11/1714%
16812/1/1612/11/1615%
1782/1/172/11/1716%
1891/1/171/11/1717%
1993/1/173/11/1718%
20102/1/172/11/1719%
21104/1/174/11/1720%
22117/1/167/11/1621%
Sheet1
Cell Formulas
RangeFormula
C2:C9C2=IFERROR(LOOKUP(1E+307,1/((A2=F:F)*(B2>=G:G)*(B2<=H:H))*I:I),0)
 
Last edited:
Upvote 0
Solution
Thanks for replay,

i have few more questions:
1. i do not understand this part marked in red, what does it do, how is it related with lookup value
IFERROR(LOOKUP(1E+307,1/((A2=F:F)*(B2>=G:G)*(B2<=H:H))*I:I),0)

2.and why did we divided lookup vector with 1
 
Upvote 0
have a read here
 
Upvote 0

Forum statistics

Threads
1,214,375
Messages
6,119,164
Members
448,870
Latest member
max_pedreira

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