I am trying to write a formula that will count all the work days in a month based on the month name. I am having a hard time trying to find information through Google on how to solve this without installing a 3rd party plugin, or writing it in VBA.
My table looks like this:
And the formula I am playing around with looks like this
=NETWORKDAYS.INTL(MONTH(A2),MONTH(A2),17)
Since it looks like the month name is a string Month(A2) will return an error. to get a date you will need to create a full string that Excel can use to return a date:
DATEVALUE("1 " & A2 & YEAR(TODAY()))
Using that and EOMONTH for the end date we get:
=NETWORKDAYS.INTL(DATEVALUE("1 " & A2 & YEAR(TODAY())),EOMONTH(DATEVALUE("1 " & A2 & YEAR(TODAY())),0),17)
Related
So i want to know how old someone was in some specific year for example if someone's date of birth is 5/3/1987 and now his age is 33 so i want to find out how old he was in lets say 2003 using some sort of formula in excel.. i tried different function to try to acheive it but no success .
You can try below formula-
=DATEDIF(A2,B2,"Y") & " Years, " & DATEDIF(A2,B2,"YM") & " Months, " & DATEDIF(A2,B2,"MD") & " Days"
I need guidance and help with an Excel question.
I am trying to automate a part of my salary slip.
I want the following , to always display the beginning of the month and end of the month.
"Period: 2018-02-01-2018-02-28"
For instance, if I have two cells in which I feed year: 2018 and month 02 or month 03 then , this should automatically update the : "Period: 2018-02-01-2018-02-28 or 2018-03-01-2018-03-31".
How can I do this?
I'm presuming that you need to do this with formula. If your year is in A1 and month in B1, type the below in C1
="Period: " & TEXT(DATE(A1,B1,"1"),"yyyy-mm-dd") & " " & TEXT(EOMONTH(DATE(A1,B1,"1"),0), "yyyy-mm-dd")
Now when you change the month in B1 (or year in A1), C1 will automatically update itself. Below is a screen shot of how it have it setup:
Try this ="Period: "&TEXT((DATE(B2,1,1)),"yyyy-mm-dd")&"-"&TEXT(EOMONTH(DATE(B2,1,1),C2-1),"yyyy-mm-dd")
How would you change this date type Monday, 31, August2015 at 6:08 AM to short date in Excel 31/08/2015 ?
Currently I use Text to Columns on the top date, find and replace to remove the comma on 31,. Then use a combination of =text(1,"00") and =month(A1&1 to format the numbers correctly and finally =concatenation() to join them all together.
This is time consuming and concatenated dates are in a different format to short date formats. When uploading data the software will see them as such.
I'm hoping there is a really easy way of doing this to save time.
It's a long formula, but it works. Before using it make sure you set the Number Formatting for the formula cell to the short date that you want.
Assuming that your awkward date is in cell A1, enter this formula in another cell:
=DATEVALUE(VALUE(SUBSTITUTE(MID(MID(A1,FIND(" ",A1)+1,99),1,2),",","")) & " " & MID(A1,FIND("|",SUBSTITUTE(A1," ","|",2))+1,3) & " " & MID(A1,FIND("|",SUBSTITUTE(A1," ","|",3))-4,4))
I have a cell into which I've typed the text "The year is 2014."
However, in my case the year might change - it might be 2015 or 2017, etc. I'd like the text within this cell to change with the value of a referenced year cell.
So, if cell A1=2015, then I want B1 to read "The year is 2015."
Any suggestions?
Using &:
="The year is "&A1&"."
Or using function:
=CONCATENATE("The year is ",A1,".")
Use following folrmula:
="The year is " & A1 & "."
I'm attempting to create a date range in a merged cell with the following:
=(A1-1) & "-" & (A1-6)
So I'm referencing a date that I have in a cell (A1) and subtracting a few days from it. Once I try to do this it returns the following:
41914-41909
I'd like to be able to keep the dates in the following format:
1/1/2014 - 1/7/2014
How would I do this?
You just need to convert the dates to text before trying to concatenate them as a string.
=TEXT(A1-1, "mm/dd/yyyy") & " - " & TEXT(A1-6, "mm/dd/yyyy")
Here's a similar question on StackOverflow: Convert date field into text in Excel. It gives a little more detail if you have any problems.