IF CONDITIONS BY DATE

BOAGS46

New Member
Joined
Mar 4, 2023
Messages
3
Office Version
  1. 2016
Platform
  1. Windows
Hi

Hoping someone can assist please. This query is actually for application in a SharePoint site, however I am using an Excel example to find out the solution so it can then be applied back into SharePoint.

I have four columns that calculate import duty on cigarettes and tobacco with the duty rate changing every 6 months. The columns are:
Column A: IMPORT DATE - in DD/MM/YYYY format
Column B: COMMODITY - input as either "CIGARETTES" or "TOBACCO"
Column C: QUANTITY
Column D: DUTY - calculated using =IF(B2="CIGARETTES",C2*1.1404,IF(B2="TOBACCO",C2*1629.14,0)) for Row 2

On 01/03/2023, the duty rates changed, so the duty calculation formula became =IF(B5="CIGARETTES",C5*1.6435,IF(B5="TOBACCO",C5*1663.36,0)) for Row 5

Is there a formula that before 01/03/2023, =IF(B2="CIGARETTES",C2*1.1404,IF(B2="TOBACCO",C2*1629.14,0)) is used and after/including 01/03/2023, =IF(B5="CIGARETTES",C5*1.6435,IF(B5="TOBACCO",C5*1663.36,0)) is used?

As mentioned, the duty rate changes every 6 months, so can the formula please include the ability to use a new IF condition to calculate the duty for dates after 01/09/2023?

Thanking you in advance.
 

Excel Facts

How can you automate Excel?
Press Alt+F11 from Windows Excel to open the Visual Basic for Applications (VBA) editor.
Hi BOAGS46

Normally, with this kind of formula which is in French, I do not know the instructions in English, sorry
In D2
Excel Formula:
=C2*SOMME.SI.ENS(J$2:J$5;I$2:I$5;B2;G$2:G$5;"<=" & A2;H$2:H$5;">=" & A2)

2023-03-04_09h51_48.png


One more
 
Upvote 1
try this, I created a lookup table so you can add duties over time. The column DUTY is your first formula repeated. Column E is what I'm asking you to consider.

Book1
ABCDEFGHI
1IMPORT DATECOMMODITYQUANTITYDUTYStart Duty DateCOMMODITYDuty
22022-03-02TOBACCO3048874.248874.202022-01-01CIGARETTES1.1404
32022-09-15TOBACCO3048874.249900.802022-01-01TOBACCO1629.14
42023-04-05TOBACCO3048874.250948.962022-07-01CIGARETTES1.6435
52022-07-05CIGARETTES45005131.87395.752022-07-01TOBACCO1663.36
62022-04-30CIGARETTES45005131.85131.802023-01-01CIGARETTES0.041
72023-03-05CIGARETTES45005131.8184.502023-01-01TOBACCO1698.299
82023-08-05CIGARETTES45005131.80.00
Sheet3
Cell Formulas
RangeFormula
D2:D8D2=IF(B2="CIGARETTES",C2*1.1404,IF(B2="TOBACCO",C2*1629.14,0))
E2:E8E2=C2*SUM((--(EOMONTH(A2,-MONTH(A2)+(INT(MONTH(A2)/6)*6))+1=$G$2:$G$7))*(--(B2=$H$2:$H$7))*($I$2:$I$7))
 
Upvote 1
Hi BOAGS46

Normally, with this kind of formula which is in French, I do not know the instructions in English, sorry
In D2
Excel Formula:
=C2*SOMME.SI.ENS(J$2:J$5;I$2:I$5;B2;G$2:G$5;"<=" & A2;H$2:H$5;">=" & A2)

View attachment 86751

One more
Thank you BrianM45. I will try your solution to see how it goes. I appreciate your time.
Kind regards
Greg
 
Upvote 0
try this, I created a lookup table so you can add duties over time. The column DUTY is your first formula repeated. Column E is what I'm asking you to consider.

Book1
ABCDEFGHI
1IMPORT DATECOMMODITYQUANTITYDUTYStart Duty DateCOMMODITYDuty
22022-03-02TOBACCO3048874.248874.202022-01-01CIGARETTES1.1404
32022-09-15TOBACCO3048874.249900.802022-01-01TOBACCO1629.14
42023-04-05TOBACCO3048874.250948.962022-07-01CIGARETTES1.6435
52022-07-05CIGARETTES45005131.87395.752022-07-01TOBACCO1663.36
62022-04-30CIGARETTES45005131.85131.802023-01-01CIGARETTES0.041
72023-03-05CIGARETTES45005131.8184.502023-01-01TOBACCO1698.299
82023-08-05CIGARETTES45005131.80.00
Sheet3
Cell Formulas
RangeFormula
D2:D8D2=IF(B2="CIGARETTES",C2*1.1404,IF(B2="TOBACCO",C2*1629.14,0))
E2:E8E2=C2*SUM((--(EOMONTH(A2,-MONTH(A2)+(INT(MONTH(A2)/6)*6))+1=$G$2:$G$7))*(--(B2=$H$2:$H$7))*($I$2:$I$7))
Thank you also awoohaw. I will try your solution also to see how it goes. I too appreciate your time.
Kind regards
Greg
 
Upvote 0

Forum statistics

Threads
1,215,054
Messages
6,122,897
Members
449,097
Latest member
dbomb1414

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