I am creating a Table in excel to help determine what the Bi-annual dates would be from an input date.
Example: If the start date of an agreement is 9/1/2017 and Ends 8/31/2018, the Bi-annual dates would be 2/28/18 and 8/31/2018. Dates of service would be 2 months before the end of the agreement period, and six months before the second service date (so 6/30/2018 and 12/31/2017 respectively).
Formula for this:
=IF(ISBLANK(O3), "",IF(EOMONTH(A1, 0)=EOMONTH(O3, -2), "BIANNUAL", IF(EOMONTH(A1, 0)=EOMONTH(O3, -8), "BIANNUAL", "")))
Where A1 refers to January, B1 would be February, and so on thru to December (L1). O3 is the Agreement End Date box, and will be static on the sheet. This formula work perfect for me.
What I am trying to get is a formula for the cells at the top that list the months (Jan-Dec). I need a formula that will put the date as 1/31/2018 for Jan, 2/28/2018 for Feb, 9/30/2017 for September (for the current year since September has not passed). The actual day needs to be the last day of the month, and if that month has passed, then the year should be for next year. I have been playing with the DATE function, but cannot get it nailed down.
What I have so far - January 2018:
=DATE(YEAR(TODAY()+365), MONTH(42766), DAY(EOMONTH(42766, 0)))
This works, but not each month will be in 2018. I need the year to change only after the month has passed.
I feel like I'm either over complicating things, or I need a way more complex formula. Please help.
In A1 place the following formula and copy right to L1 or as far as you need to go
=EOMONTH($O$2,COLUMN(A1)-1)
It will display the end of month dates starting with the starting month of the contract and increasing by 1 month for each column you move right.
In the image below, it is the same formula in row 1 and row 2. Row one I choose custom format instead of date and set the custom format to mmmm. 4 m's will give you the full month, and 3 m's will give you the 3 starting letters of the month.
I actually figured this out this morning just playing with the IF function. My goal was to have the sheet update itself without having to change the dates every time your open it. So that the file could be shared with others and all you would have to enter is the end of the contract date, and it will list out Biannual, Tri-annual, and Quarterly months (see image).
Formula:
=IF(DATE(YEAR(TODAY()), MONTH(42766), DAY(EOMONTH(42766, 0)))<TODAY(), DATE(YEAR(TODAY()+365), MONTH(42766), DAY(EOMONTH(42766, 0))), DATE(YEAR(TODAY()), MONTH(42766), DAY(EOMONTH(42766, 0))))
Where I used the serial for each month (in this case 1/31/2017, as I didn't need to worry about the year)
Results
Related
I would like to ask for a bit of help, as I can't figure it out myself.
What I would like to end up is, get the total calculation of the work time hours for each name only for the month written in A5 cell.
So far I used this code to have the start date Monday, based on the date in A5 cell.
=A5-MOD(A5-2,7)
With this community help I ended up with this code to count the work time for each name in the week (lots of students in the schedule)
=SUMPRODUCT(IFERROR(TIMEVALUE(MID(C7:H7,FIND("-",C7:H7,1)+1,LEN(C7:H7)-FIND("-",C7:H7,1))) - TIMEVALUE(LEFT(C7:H7,FIND("-",C7:H7,1)-1)),0))
The help I need, if it's possible, is to figure out how to get the total work time only for the month entered in cell A5 (which is 1.october - 31.october) without counting the last 3 days in September. I plan to use this spreadsheet for the following months as well. I tried to use COUNTIFS, but no luck so far. Also, I am using an online excel version, which is very limited in the menu.
Thanks in advance for any help.
=TEXT(c6, "mmm") will give Sep, while TEXT(A5, "mmm") will give Oct. You need to SUMIF the month matches.
You could incorporate this together with the equation you already have but I think it might be easier to create a duplicate table below the main table, copying the day of the month and the names and using your above mentioned equation to get the hours to be summed.
Either above or below the date, or instead of the date, I'd pull out the month with =TEXT(C6, "mmm")
Lets say the duplicate table for cells B16-I12 was in cells B106-I112 with the extra row specifying the month above this in row 105 (=TEXT(C106, "mmm") etc.).
Then in cell D24, you'd have
=SUMIF(C$105:I$105,TEXT($A$5,"mmm"),C107:I107) +[same again for the next week, cells B15-I21] + [same again for the next week] etc.
This can then be copied down for all the names.
You could also feed this information up into cells K7, K8,K12, becuase you only need this for the first and last months. So J6 would read 'hours this week' K6 would read Hours last month, L6, hours this month. Then D24 could sum L7 and J16 etc.
I have daily data from 01-Jan-2005 till 29-Dec-2017. I want for each year to select the last day of March, June, September, and December, alongside their respective data. Part of the data:
Date Variable
30-Mar-2005 1.2943
31-Mar-2005 1.2964
1-Apr-2005 1.2959
4-Apr-2005 1.2883
5-Apr-2005 1.281
I.E: For 2005, I want the dates of 31-March-2005, 30-June-2005, 30-September-2005, and 30-Dec-2005. Desired output:
Date Variable
31-Mar-2005 1.2964
30-Jun-2005 1.9859
30-Sep-2005 1.2233
30-Dec-2005 1.2814
I currently have the build in excel formulas (i haven't installed any other plug-ins etc).
More specifically: on the left i have the data, and on the right the desired output.
Not sure if this is going to work to you, but anyways.
Looks like you always look at the last day of months March, June, September and December on a specific year (in example, 2005).
But you are not looking for the last natural day of each month. You want the last day of each month that appears in your data (in example, that explains why you use 30 december 2005 instead of 31, because there is no 31).
In Excel, dates are numbers. The more you go in the future, a bigger number is related. Knowing this, you can get the date for each month just looking the MAX value of a range of dates.
But first, you need to define the range of dates, using 2 conditions:
Month of date must be March, June, September and December
You want dates for a specific year (in example, 2005).
To get this, you need an array formula. My formula gets the max day of a specific month and year. To test it, in my Excel I did a dates series, starting in 01/01/2005 and done in 31/12/2017. I deleted manually 31/12/2005 because that date has no data.
In cell I4, just type the year you want to check. The formula will get he last day of months March, June, September and December of that year.
My array formula is:
=MAX(IF(MONTH(IF(YEAR($A$4:$A$4750)=$I$4;$A$4:$A$4750))=3;$A$4:$A$4750))
IMPORTANT!: Because it is an array formula, you will need to type it
as usual, and then, instead of pressing Enter press
CTRL+SHIFT+ENTER
You need 4 times this formula. Just change the 3 (March) for the number of the month you need (6,9 and 12).
Now that you have the dates, you just need a VlookUp to get the value you want.
=VLOOKUP(G5;$A$4:$B$4750;2;false)
If I change the year value, i get those new values:
If you want to check the file. I uploaded an example to Gdrive, so you can download if you want.Download
Anyways, try to adapt this formulas to your needs.
I converted a list of Euro conversions into a Table and used structured references. But you can use normal range references if you prefer.
In some other table, enter the following formula, where $A$45 refers to the first quarter ending date in your data table.
F2: =IF(EOMONTH($A$45,(ROWS($1:1)-1)*3)>MAX(Table1[Date]),"",LOOKUP(2,1/(EOMONTH($A$45,(ROWS($1:1)-1)*3)>=Table1[Date]),Table1[Date]))
In the adjacent column, enter the formula:
G2: =IFERROR(VLOOKUP(F3,Table1,2,FALSE),"")
And fill down until you get blanks.
(in my sample table, the last date is 1/27/2006 so the last included "End date" is 12/30/2005, there being no data for 12/31/2005)
So, there are two cases
When you have the exact last days of the month. (Its simpler).
I had a fortnightly data. I adopted this simple and innovative method. From all the dates, I first extracted the day using Day() function. for example, Day(A1). (Remember, while doing this, do not delete your original date column. Do it in a separate column as this would help you match the dates later).
Then I sorted the data using the Day column, just constructed before, in decreasing order. This would place all end dates at first. And then deleted the starting dates which were at bottom. So, now I am left with only end dates but obviously months are not in order.
So, create another column extracting just the month and year from the original date column using =MONTH(A1) & "/" & YEAR(A1). Sort the data using this column. And, you are good to go!
When you do not have the exact last days, but maximum dates like the one shown above in picture.
In this, while deleting the initial dates, you would have to take care of which date on-wards you need to delete.
For example, I deleted day 17 on-wards of months with 31 days (including day 17) and day 16 on-wards of months with 30 days (if present) because if there was this date, suppose, 18 April 2018, then this would be the last day of the month as I had a fortnightly data.
I am building a template for a data entry spreadsheet at work for some of the old-timers. The template that they will see will be columns of categories and the rows will be dates including the day of the week. I know how to auto-fill the date an day by drag and drop, but honestly some of these guys even screw that up. So, I am building this spreadsheet that auto populates the date and the day for the whole month based on entering the first day of the month that way its as simple as possible, but I am having trouble with the 31st day of some months. I don't want to have two different spreadsheets. Right now the code that I have is:
=EOMONTH(A5,0)
This works if it is the 31st day of the month, which is great, but if it is not a month that has 31 days it repeats the 30th day. I'd really like it to be an if statement, but I know my code is off because it always generates a FALSE.
Is =if(A5(M<2),"EOMONTH(A5,0)") heading in the right direction? It generates a #REF! reponse with that code.
Thank you for any input!
In A5 enter the date of the first day of the month. In A6 enter:
=A5 + 1
and copy downwards.
In A35 enter:
=IF(DAY(A34+1)=1,"",A34+1)
This assumes that you are making the date sequence by adding 1 to the cell above.
EDIT#1:
Put this in A6:
=IF(A5="","",IF(DAY(A5+1)<DAY(A5),"",A5+1))
and copy downwards through A35.
This will handle long months, short months, leap years, etc.
(this also has the advantage of maintaining the same formula for the entire set of cells)
You just need to add an IFERROR before the IF to fix the February problem:
=IFERROR(IF(DAY(A34+1)=1,"",A34+1),"")
I am trying to establish the best way to write a formula to take a date that is inputted in a cell by a user and subtract it from the last day of the month (the due date), not taking into account what year it is. The cell that contains the formula will be in another cell, pointing at the user inputted date cell.
I have 12 columns running across with each with one of the months of the calendar year. In each column for the corresponding month is where the user will input the date they completed a task. I would like to subtract their input from the last day of the corresponding month in that column. I want to reuse this spreadsheet every year, so I do not want to account for the year in my formula. I hope this will prevent me having to update the formulas each year.
An example would be if the user inputted 2/24/17 into C7, because the column C is the column for February, I would like the result to be -3 (I am not worried about leap years at this point). If they inputted 3/11/17 into the same cell (C7), they would get a result of 11, because the date is 11 days past the due date.
Here is the formula that I started to use, but I believe it is relative to the current year.
=IF(ISBLANK(C7),"",C7-(DATE(YEAR(TODAY()),MONTH(1)+2,1)-1))
Here is a link to a picture of my spreadsheet. Thank you in advance for your help!
Solution
Changed YEAR(TODAY()) to YEAR(target cell). My new formula looks like:
=IF(ISBLANK(C7),"",C7-(DATE(YEAR(C7),MONTH(1)+2,1)-1))
Maybe:
=IF(C7="","",C7-EOMONTH(C7,-1))
(based on #barry houdini's Comment and subsequent OP clarification via a Comment).
So I basically have to create a gantt type chart that automatically fills in the start and end month of the project. The problem I'm having is that I have a specific start and end date like, Start: 06/17/18 and End: 07/20/19.
My Chart is categorized by months and not specific dates, so for this example I would need it to populate the cells starting from June 2018 until July of 2019.
I'm having some problems because I made an if statement that looked at the month and populated the cells by month, however, it would then only fill in the june and july cells of 2018 and 2019 and would leave all the other cells in between blank. I then added another filter for it to also look at the year, except it didn't help because since my "if statement" looks for everything in between the 6th and 7th month, it doesn't populate the 8th, 9th and other months of the rest of 2018 and the beginning months of 2019.
Here is my if statement:
=IF(AND(MONTH(N$3)>=MONTH($I5),MONTH(N$3)<=MONTH($J5), YEAR(N$3)>=YEAR($I5),YEAR(N$3)<=YEAR($J5)),"")
Here is a snippet of the work:
Make sure your month names are actually dates like 1/1/18, you can custom format them to be mmmm-yy to give January-18, then you can use the following formula.
=IF(OR($I4>=N$3, $J4>=N$3), IF(OR($I4<O$3, $J4<O$3), "inc", "ex"), "ex")
Put this in N4 then copy it to cover your range. It uses OR instead of AND to check whether either start or finish date is after or equal to the 1st of the month, likewise for less than the 1st of the next month.
The out put will give you inc for if that month is included in the dates and ex for if its excluded, so you can change either the formula or conditional formatting to colour.
This won't work on the very last column of data, so where you months end, eg December-19 you will have to put 1/1/20 in either the next column heading, or hard coded in the formula where required.
EDIT
Modified the formula as I realised you're in column I and J, not A and B.
=IF(NOT(ISBLANK($I4)), IF(OR($I4>=N$3, $J4>=N$3), IF(OR($I4<O$3, $J4<O$3), "inc", "ex"), "ex"), IF(NOT(ISBLANK($J4)), IF(AND(O$3>$J4, $J4>=N$3), "inc", "ex"), "ex"))