Rounding issues

edeneye

New Member
Joined
Sep 16, 2024
Messages
4
Office Version
  1. 2016
Platform
  1. Windows
Hi EXCEL smes,

I'm having a tough time finding a severance formula that works for calculating through to the final result required due to either rounding issues or formula incompatibilities.
Year frac or Datedif formulas do not appear to work.

I require the following - Multiply an employee's regular wages for a regular work week by the sum of: the number of completed years of employment; and the number of completed months of employment divided by 12 for a year that is not completed.

Based on my country's regs, the result also needs to fit the following parameters to additionally calculate =IF(A2<5,"0",IF(A2<26,(A2*B2),IF(A2>=26,(B2*26))))

Thanks so much for your insights!
 

Excel Facts

Shade all formula cells
To shade all formula cells: Home, Find & Select, Formulas to select all formulas. Then apply a light fill color.
Welcome to the Board!

If can be difficult to help when a formula is provided without seeing your data (and how it is laid out).
Can you post of few example of your data along with your expected results?

MrExcel has a tool called “XL2BB” that lets you post samples of your data that will allow us to copy/paste it to our Excel spreadsheets, so we can work with the same copy of data that you are. Instructions on using this tool can be found here: XL2BB Add-in

Note that there is also a "Test Here” forum on this board. This is a place where you can test using this tool (or any other posting techniques that you want to test) before trying to use those tools in your actual posts.
 
Upvote 0
Years of Service.xlsx
ABCDEFGHI
1NameHire Date Hourly Pay Weekly Pay TERM DATEYOSSev to MAX (DOH>5yrs)
2EE126/10/1987$27.69$1,107.6002/01/202436.2136 yrs, 2 mths36.2528797.60
3EE216/11/1998$27.69$1,107.6002/01/202425.1525 yrs, 1 mths25.1727850.83
4EE324/10/2011$27.69$1,107.6002/01/202412.2012 yrs, 2 mths12.2513512.72
5EE423/09/2021$24.92$996.8002/01/20242.282 yrs, 3 mths2.330
Sheet1
Cell Formulas
RangeFormula
F2:F5F2=(E2-B2)/365
G2:G5G2=DATEDIF(B2,E2,"y")&" yrs, "&DATEDIF(B2,E2,"ym")&" mths"
H2:H5H2=DATEDIF(EOMONTH(B2,-1),E2,"m")/12
I2:I5I2=IF(F2<5,"0",IF(F2<26,(F2*(C2*40)),IF(F2>=26,((C2*40)*26))))
D2:D5D2=C2*40
 
Upvote 0
Years of Service.xlsx
ABCDEFGHI
1NameHire Date Hourly Pay Weekly Pay TERM DATEYOSSev to MAX (DOH>5yrs)
2EE126/10/1987$27.69$1,107.6002/01/202436.2136 yrs, 2 mths36.2528797.60
3EE216/11/1998$27.69$1,107.6002/01/202425.1525 yrs, 1 mths25.1727850.83
4EE324/10/2011$27.69$1,107.6002/01/202412.2012 yrs, 2 mths12.2513512.72
5EE423/09/2021$24.92$996.8002/01/20242.282 yrs, 3 mths2.330
Sheet1
Cell Formulas
RangeFormula
F2:F5F2=(E2-B2)/365
G2:G5G2=DATEDIF(B2,E2,"y")&" yrs, "&DATEDIF(B2,E2,"ym")&" mths"
H2:H5H2=DATEDIF(EOMONTH(B2,-1),E2,"m")/12
I2:I5I2=IF(F2<5,"0",IF(F2<26,(F2*(C2*40)),IF(F2>=26,((C2*40)*26))))
D2:D5D2=C2*40
The G2 formula is the most correct, although I am at a loss on how to transpose this result into a number (including fraction of completed months) that can be used in another formula
 
Upvote 0
The G2 formula is the most correct, although I am at a loss on how to transpose this result into a number (including fraction of completed months) that can be used in another formula
I think this formula will give you what you need:
Excel Formula:
=DATEDIF(B2,E2,"m")/12

It returns the value show on the right on the below grid (where left column is what your column G returns):
1726512235775.png
 
Upvote 0
Solution
Duh, I think this works. I remember trying this one before, but it rounded up all of the numbers (rising overall cost) - for some reason I didn't think of expanding it to 3 decimal places for closer result

Very much appreciated!
 
Upvote 0
You are welcome.
Glad I was able to help.
 
Upvote 0

Forum statistics

Threads
1,221,531
Messages
6,160,355
Members
451,640
Latest member
idavies1402

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