Salary Calculation in Excel - excel

So I have a problem that I'm dealing with for days now and I cant figure it out. I have this problem in excel, I am looking for assistance regarding a calculation. I want to be able to calculate a payment date schedule based on a set monthly payment date but to exclude exclude weekends and specific holiday dates e.g.
Here's My file I'm Working on:[].
Here is some function that I already used : =IF(TEXT(O2,"dddd")=$U$2,O2+2,IF(TEXT(O2,"dddd")=$U$3,O2+1,O2))This works for only weekends, It doesn't work on holidays, I want it to work not only on weekends and on holidays too.
Thanks in advance.

This can be done by using the WORKDAY() function together with the DATE() function.
B2 contains year - 2012
B3 contains payment day - 28
A5:A17 contain payment periods (month numbers) - 1..12
D6:D16 contain holidays
=WORKDAY(DATE($B$2,A6,$B$3-1),1,$D$6:$D$14)
Also see the linked image. (NB: My Excel version uses semi-colon ";" in stead of comma "," to separate arguments in functions.)
Best of luck!
Xharx
Image of the Excel sheet solution

Here's How u Do it. First we have to have starting month from where were gonna start counting I made this formula which works great, =WORKDAY(EDATE($B$15,COUNT($B$15:B17))-1,1,holiday1)
were freezing the starting date and counting how many rows are we from the starting position , then were gonna minus 1 from it , and in days were gonna type 1, if there's holidays that I wanna exclude too I just can enter it and give it a name, (Some of u who doesn't understand this, its just saying that its referring to specified cells which we named holidays) and it works flawlessly.
B15 = starting month

Related

Get working day of the month with the lowest value

I have a excel spreadsheet with two columns. One with a date and another with the value.
I want to get the working day of the month with the lowest value.
I tried to use a pivot table for it and then group the date but I get a lot of errors.
You can find the spreadsheet here and the sheet name is Historical. The others are just attempts made by me.
Spreadsheet
Thanks
The formula entered in E2 below
is
=AGGREGATE(15,6,(POWER(10,LOG10(((YEAR(D2)=YEAR($A$2:$A$3254))*(MONTH(D2)=MONTH($A$2:$A$3254)))))*$B$2:$B$3254),1)
and the array formula entered in F2 below is
=INDEX($A$2:$A$3254,MATCH(YEAR(D2)&MONTH(D2)&E2,YEAR($A$2:$A$3254)&MONTH($A$2:$A$3254)&$B$2:$B$3254,0))
I suggest to make an triple nested if-construct that checks if the weekday of the date is a workday, or the date+ 1 or the day +2. Assuming the date is in cell A4
= if(instr(weekday(A4),”23456”)>0, A4,
if(instr(weekday(A4+1),”23456”)>0, A4 + 1,
if(instr(weekday(A4+2),”23456”)>0, A4 + 2,”cannot happen”)))
Explanation: one of 3 consecutive days is always a working day.
There may be typos since I edit that on iPad without Excel available to test.
Weekday returns 1 for Sunday and 7 for Saturday. So 2-6 are workdays.
However with that simple approach you will not detect public holidays on a working day if that is a problem.
Hope I understood you question correctly. One data example with solution would have explained it better.

Can I test my Excel formulas as if today was some day in the future?

I am building a new dashboard that refreshes on a daily basis. The dashboard includes current month data as well as prior month data. However, I need to try a few different scenarios in terms of dates to ensure that month transitions work with no problem. For example, I would like to know what my formulas would do when it is the first day of the month, and the second day of the month with different conditions such as the 1st day being weekends or holidays, etc, where I won't have any data, which would lead to errors.
I tried fixing formulas, but there were way too many formulas involved and related to each other. Also data is being pulled from SQL server, where I am also using GETDATE().
For example, one of my formulas show
=YEAR(TODAY()-1)&IF(MONTH(TODAY()-1)<10,0&MONTH(TODAY()-1),MONTH(TODAY()-1))
to get the year & month (e.g. 201904 for 2019 April). This is one of many formulas that has today() built in
In sum, I am wondering if I can change the date that Excel is reading off. For example, I have a formula with =TODAY() - I want this formula to return some other days I set to, rather than actual date of today.
First place this user defined function in a standard module:
Public Function todaz() As Date
todaz = Evaluate("=today()") + 12
End Function
Then in your worksheet, replace all instances of:
Today()
with:
todaz()
You can change the User defined function to have any date offset you wish.
When you are done testing, change all the todaz() back into Today().
Here's a non-VBA version:
Have a cell in which you put just =Today(). In the worksheet, replace all other instances of Today() with a reference to this cell. For testing, replace the Today() with whatever date you like, and when you're done, put the Today() back in.
Both this and Gary's Student's version have the advantage of being less volatile - that is, they will run much faster because Today() is one of those functions that recalculates frequently in every place it appears -- and in your case that sounds like a lot.

Excel (if statement, maybe?) Birthday List or Vlookup

Hello I am trying to use a simple excel sheet (last name, first name, date of birth, date of hire) for an employee listing to then create a list of birthdays (pro[bably +/- 7 days) - just the last & first name. Secondly the same thing for the hire date (probably +/- 14 days) and the years of service, that calculation I figured out easily.
I was trying to do this with if statements or datedif and am struggling.
maybe this isnt the proper tool, any thoughts, suggestions would be greatly appreciated!
Please see sample data screen shot below:
expected output:
Maybe this would be better as a vlookup?
Thank you
OK, so here is what I came up with based on my understanding of the question:
=IF(OR(DATEDIF(B2,TODAY(),"YD")<=7,DATEDIF(B2,TODAY(),"YD")>=359),A2,"NO")
The formula here takes number of days between the birthday and today (ignoring the years) and checks if they're less than or equal to 7 or more than or equal to 359.
Sample spreadsheet: https://www.dropbox.com/s/kxgi9eeoikems66/Birthday.xlsx?dl=0
Insert two more columns for month of birth and month of hiring. Add the following formula in both consecutively
=TEXT(C1,”MMMM”) and =TEXT(D1,”MMMM”)
The final sheet will look like this
After that select all of your data and insert Pivot table and format it like the below
You will get an auto updatable sheet without any macros and extra work

How do I shorten the formula for comparing two dates in excel standard date format?

I have created a formula to compare two dates. M673 is a date that is manually entered but sometime copied over which leaves that unnecessary " "in the front from time to time which makes the date extraction difficult (that's why I trimmed it). The date in N673 is extracted from a manually entered period (i.e. 08/2015) 08 is actually October (10). The extraction formula looks as follows:
(N673)=IF(A673="","",DATE(RIGHT(A673,4),LEFT(A673,2)+3,))
This is to ensure it updates for every period posted automatically.
The below formula says if M673 is before N673 but on the first day of that month and year, then it becomes 1 else its a 0.
Any way to shorten the below formula?
(G673)=IF(DATE(LEFT(TEXT(TRIM(M673),"yyyy-mm-dd"),4),MID(TEXT(TRIM(M673),"yyyy-mm-dd"),6,2),RIGHT(TEXT(TRIM(M673),"yyyy-mm-dd"),2))<(DATE(LEFT(TEXT(N673,"yyyy-mm-dd"),4),MID(TEXT(N673,"yyyy-mm-dd"),6,2),1)),1,0)
Have you tried to use DATEVALUE? The following should work for the scenario you have described above.
(G673)=IF(DATEVALUE(TRIM(M673))<N673,1,0)
There's no need to create a new date based on all the parts. This is what DATEVALUE will do for you automatically.

Date range in Excel using WORKDAY.INTL to exclude holidays

I am creating a spreadsheet to show two-week intervals, excluding weekends and defined holidays. This is going to expand to next June so I want to just copy and paste all the way across.
For example:
11/9/2015-11/20/2015
I'm using:
=TEXT(WORKDAY.INTL("2015/11/9", 0,1, $W$3:$W$28)+(COLUMNS($A:A)-1)*14, "mm/dd/yy")&"-"&TEXT(WORKDAY.INTL("2015/11/9", 0,1, $W$3:$W$28)+(COLUMNS($A:A)-1)*14+11, "mm/dd/yy")
With example holidays:
11/23/2015
11/24/2015
11/25/2015
11/26/2015
11/27/2015
Hidden away on the in the W column.
When I copy and paste across, the date ranges are increasing appropriately but they are not excluding the example holidays I have defined. If I start in the set of holidays it excludes them as they should but if I add more holidays to test, the same result. My formula was kind of just cobbled together, any help or ideas would be great. Another hangup is that coworkers want it in Google Sheets.
Try this:
=TEXT(WORKDAY.INTL("2015/11/9", (COLUMNS($A:A)-1)*10,1, $E$13:$E$17), "mm/dd/yy")&"-"&TEXT(WORKDAY.INTL("2015/11/9",(COLUMNS($A:B)-1)*9+COLUMNS($A:A)-1,1, $E$13:$E$17), "mm/dd/yy")
Use the [holidays] option.
Basic Description
The Excel Workday function returns a date that is a supplied number of
working days (excluding weekends and holidays) ahead of a given start
date.
The syntax of the function is: WORKDAY( start_date, days, [holidays] )
where the arguments are as follows: start_date - The initial date,
from which to count the number of workdays. days - The number of
workdays to add onto start_date. [holidays] - An optional argument,
which specifies an array of dates (in addition to weekends) that are
not to be counted as working days.
Note that the start_date and [holidays] arguments should be input as
either:
References to cells containing dates
or
Dates returned from formulas
If you attempt to input these date arguments as text, there is a risk that Excel may misinterpret them, due to different date systems,
or date interpretation settings.
SOURCE

Resources