Been trying to find an easy way to calculate the previous month values. Not sure how to get it to work correctly.
This is what I did for Current Month:
IIF(DATETRUNC('month',[Approved for Hire Date]) = DATETRUNC('month',TODAY()),'true','false')
What I tried for Previous Month"
IIF(DATETRUNC('month',[Offer Accepted Date]) = DATETRUNC('month',-1,DATETRUNC('month',TODAY())),'true','false')
I have a date which I will need to increment the date by a day, month or year from the actual date. This is based of a list of fields below and is different per the input. Also each resultant date has to be a business day i.e not a weekend day or a bank holiday. Also if the resultant date is either Dec 25 or Jan 1st the day needs to move forward to the next business day (not a weekend day).
I have created this in Excel using a couple of formulas though it is a bit clunky.
Below is my data set
Business Date 15/05/2018
Tenor Settlement Value Settlement Period
ON 1 Day
TN 2 Day
SP 2 Day
SN 3 Day
1W 7 Day
2W 14 Day
3W 21 Day
1M 1 Month
2M 2 Month
3M 3 Month
In column E - I am using formula
=IF(D4="Day",$B$1+C4,IF(D4="Month",EDATE($B$1,C4),(TEXT($B$1,"dd/mm/")&(YEAR($B$1)+C4))+0))
In column F - I am using formula
=E4+LOOKUP(WEEKDAY(E4),{1,2,3,4,5,6,7},{1,0,0,0,0,0,2})
In column G - I am using formula
=F4+IF(AND(OR(TEXT(F4,"ddmm")="2512",TEXT(F4,"ddmm")="0101"),WEEKDAY(F4)>=2,WEEKDAY(F4)<=6),LOOKUP(WEEKDAY(F4),{1,2,3,4,5,6,7},{0,1,1,1,1,3,0}),LOOKUP(WEEKDAY(F4),{1,2,3,4,5,6,7},{1,0,0,0,0,0,2}))
In H I format the date in mm/dd/yyyy and I have my desired result.
storax has kindly created a function for me which replicates my excel formula in column E - on this thread Increment a date by a number of days, months or years
Function IncDate(ByVal dt As Date, ByVal add As Long, ByVal dmy As String) As Date
Select Case UCase(dmy)
Case "DAY"
IncDate = DateAdd("d", add, dt)
Case "MONTH"
IncDate = DateAdd("m", add, dt)
Case "YEAR"
IncDate = DateAdd("yyyy", add, dt)
Case Else
IncDate = dt
End Select
Could use some advise on how I could incorporate my formulas in columns F & G to make the process less clunky.
Manipulating the DATE function (DateSerial in vba) with the WORKDAY.INTL function seems to produce the correct business dates.
Put this in E4 and fill down.
=WORKDAY.INTL(DATE(YEAR(B$1)+(D4="year")*C4, MONTH(B$1)+(D4="month")*C4, DAY(B$1)+(D4="day")*C4)-1, 1, 1, holidays)
[holidays] is a named range (Formulas, Defined Names, Defined Name) with a Refers To: of,
=Sheet10!$Z$2:INDEX(Sheet10!$Z:$Z, MATCH(1E+99, Sheet10!$Z:$Z))
I'm trying to display quarters based on the financial year: Q1 starting in April, Q2 from July, etc.
In column B there is a list of dates, and in column A I want the corresponding quarter & year. There are 2 parts I can't figure out:
currently for 01 JAN 2018 it shows Q4 2018. Although the date is 2018, it's the final quarter of 2017 and should show Q4 2017
how to get the display format like Q1 17/18 (eg)
At the moment I have:
=CHOOSE(INT((MONTH(B1)-1)/3)+1,"Q4","Q1","Q2","Q3") & " " & YEAR(B1)
Is it possible without any helper columns?
Subtract a Boolean expression from the Year part:
YEAR(B1) - (MONTH(B1)<4)
If the MONTH is Less than 4 it will subtract 1 from the year, otherwise it will subtract 0:
=CHOOSE(INT((MONTH(B1)-1)/3)+1,"Q4","Q1","Q2","Q3") & " " & YEAR(B1) - (MONTH(B1)<4)
I have created a report with a slider that filters on year. The client however would like to not see the future month zero values. I am not quite sure how to modify the year and month filters so that if [fiscal year] = (year(current_date) then [Fiscal Year Month Number] to (month(current_date) I have attached a couple of screenshots. "Period" in the X axis is sorted by Fiscal Year and Fiscal Year Month Number.enter image description here
Thank you
I was trying to add this as a filter when I should have added it as a new measure.
if([Fiscal Year]=[Current Year] and [Fiscal Year Month #]<=[Current Month]) then ([Corp FY Data])
else
if([Fiscal Year]=[Current Year] and [Fiscal Year Month #]>[Current Month]) then (null)
else
if([Fiscal Year]>[Current Year]) then (null)
else
if([Fiscal Year]<[Current Year]) then ([Corp FY Data]) else (0)
Problem resolved. Yeah me. ;)
How to make and saved search to verify todays employee has exactly 1 year on company.
Example:
employee1 hiredate = 10/02/2015
employee2 hiredate = 11/02/2015
employee3 hiredate = 10/02/2012
employee4 hiredate = 10/02/2008
employee5 hiredate = 13/04/2008
Get saved search with all employee are 1 or more years old.
The result will be if today are 10/02/2016:
employee1 = 1 year on company.
employee3 = 4 year on company.
employee4 = 8 years on company.
Thats possible?
My wrong formula are:
MOD((ROUND({today},'DAY')-ROUND({hiredate},'DAY'))/365, 1) is 0
Thanks!
You should not need a formula at all for this. You can just set up a filter on your saved search where the field is "Hire Date", the operator is "on or before", and the value is "same day last fiscal year". If you only want exactly one year ago, you can use "on" instead of "on or before".
If you want Employees that are more than 1 year but less than 2 years, then just add a second filter of "Hire Date - on or after - same day fiscal year before last".
I was able to achieve the same using the below formula(numeric) filter:
MOD(MONTHS_BETWEEN({today}, {hiredate}),12) is equalto 0
this will give you the employees having anniversary.
To get the number of years add the formula(numeric) search column with formula:
FLOOR(MONTHS_BETWEEN({today}, {hiredate})/12)