Need help with DATEDIF

worley3

New Member
Joined
Jun 8, 2020
Messages
1
Office Version
  1. 2016
Platform
  1. Windows
I have two columns that I have a report date (AL) and end date (BA). I am using DATEDIF to calculate the number of days in between.

I also want to use those days to convert to how many days of leave acquired. For instance, if the number of days is 1-6 they would acquire .5 days, 7-12 equals 1 day, 13-18 equals 1.5 days, 19-24 equals 2 days, etc.

Is there a way to do all of this within the same column?
 

Excel Facts

Convert text numbers to real numbers
Select a column containing text numbers. Press Alt+D E F to quickly convert text to numbers. Faster than "Convert to Number"
Try something like the following
You could build a lookup table.

T202006a.xlsm
BCD
1Report DateEnd Date
201-06-2010-06-201
4b
Cell Formulas
RangeFormula
D2D2=LOOKUP((C2-B2),{1,0.5;7,1;13,1.5;19,2})


T202006a.xlsm
BCD
1Report DateEnd Date
201-06-2010-06-201
301-06-2010-06-201
4
4b
Cell Formulas
RangeFormula
D2D2=LOOKUP(C2-B2,{1,0.5;7,1;13,1.5;19,2})
D3D3=LOOKUP(DATEDIF(B3,C3,"d"),I2:J5)
 
Upvote 0

Forum statistics

Threads
1,214,989
Messages
6,122,622
Members
449,093
Latest member
catterz66

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