IF cell is 0-2 years then 100% IF 2-3 years then 75% and so on....

Padthelad

Board Regular
Joined
May 13, 2016
Messages
64
Office Version
  1. 2016
Platform
  1. Windows
Hi,

I am having trouble working the logic for the below scenario:-

I am aiming to achieve a workbook that will automatically tell me what deduction to make if time between two dates is under 2 years (100%), 2-3 years (75%), 3-4 years (50%) and over 4 years (0%).

I have a workbook with a list of dates in column B and column G. Column H has the difference in years, months and days. Column H has the following code:-

=DATEDIF(B7,G7,"y")&" years "&DATEDIF(B7,G7,"ym")&" months "&DATEDIF(B7,G7,"md")&" days"

I am trying to have column I auto populate with the correct deduction depending on the difference between the two dates in column B and G. Table is as follows:-

B
C
D
E
F
G
H
I
7
02/01/2018
ITEM 1
105.00
21.00
126.0
14/09/2018
0 years 8 months 12 days
100%

<tbody>
</tbody>

The formula I currently have in I1 is:-

=IF(DATEDIF(B6,TODAY(),"y")<=2,"100%",$T$10)

This gives me the desired result, but it does not change if the dates are changed in column B and G.

I have the following table where the deduction amounts are stored. Ideally I would like the formula to take it's information from here so that changes to deductions can be made in the future.

P
Q
R
S
T
10
Up to 2 Years
2
100%
No Deduction
11
2-3 years
2
3
75%
12
3-4 years
3
4
50%
13
Over 4 years
0%

<tbody>
</tbody>

I hope this all makes sense. I think I may be using the wrong formulas for this problem.

Any help or advice is very much appreciated.

Thanks,

Pad
 

Excel Facts

Workdays for a market open Mon, Wed, Friday?
Yes! Use "0101011" for the weekend argument in NETWORKDAYS.INTL or WORKDAY.INTL. The 7 digits start on Monday. 1 means it is a weekend.
Excel 2010
BCDEFGHIJ
62-Jan-1814-Sep-18100%
72-Jan-1814-Sep-18100%100%
82-Jan-1614-Sep-1875%75%
9
10
1114-Sep-1614-Sep-18100%
1213-Sep-1614-Sep-1875%
132-Jan-1514-Sep-1850%
1402-01-1414-Sep-180%
15

<colgroup><col><col><col><col><col><col><col><col><col><col></colgroup><thead>
</thead><tbody>
</tbody>
7c

Worksheet Formulas
CellFormula
I6=IF(DATEDIF(B6,TODAY(),"y")<=2,1,$S$9)
I7=LOOKUP(DATEDIF(B7,TODAY(),"y"),{0,1;2,0.75;3,0.5;4,0})
J7=IF((G7-B7)<731,1,IF((G7-B7)<1096,0.75,IF((G7-B7)<=1461,0.5,0)))
J11=IF((G11-B11)<731,1,IF((G11-B11)<1096,0.75,IF((G11-B11)<=1461,0.5,0)))

<thead>
</thead><tbody>
</tbody>

<tbody>
</tbody>

Thanks Dave. Also worked well and is simple to follow.

Thanks for your help.
 
Upvote 0

Forum statistics

Threads
1,215,093
Messages
6,123,068
Members
449,091
Latest member
remmuS24

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