I have an overly complicated spreadsheet to show when employees have taken leave from dates in a table. It behaves differently based on if today is before or after their anniversary date. There are no macros, I'd like to keep it that way.
Currently:
Cell A1 = Today()
cell A2 = date pulled from a table, displayed as 01/01/20
I'm trying to have Cell A1 display the first of next months date if the date in cell A2 is the current month. This would push my calendar into the next years schedule. It is April, if an employee's anniversary is in April I would like A1 to show 5/1/20.
So, if A2 is not the current month, A1 shows Today(). If A2 is the current month, A1 shows the first day of the next month.
Something like this, maybe:
=IF(TEXT(TODAY(),"yyyyMM")=TEXT(A2,"yyyyMM"),DATE(YEAR(TODAY()),MONTH(TODAY())+1,1),TODAY())
Looking at the situation you present, this is I think the formula you need to use in A1:
=IF(MONTH(A2)=MONTH(TODAY()),EDATE(A2,1),TODAY())
so, we have:
If A2 month is the Current Month: MONTH(A2)=MONTH(TODAY())
Then use the next month first date: EDATE(A2,1)
Otherwise use Today's date: TODAY()
Hope this will solve your problem.
Related
Lab has to keep track of when preventative maintenance (PM) was done and when the next PM is due. I want to enter the date PM was performed in a cell and then have another cell automatically update to a year or six months later.
Suppose you have your data in A1, the formula to add 6 month to the data in B1 is
=EDATE(A1;6)
Then format the cell B1 to date
Same applyes to C1, add 12 to obtain 1 year from the date
I was wondering if it's possible to use info from a cell in creating a formula. Here's the situation;
A1 = Date (01/01/17)
A2 = Month from that date (January)
I have different worksheets in the book for every month so for January the sheet is called January.
Is it possible to create a formula where I can reference a cell in a page that corresponds to the month in A2.
So for example in A3 the formula would be =January!A1
But instead of Jan I want it to be dynamic so it would change to any month depending on what I input in previous cells.
In A2 to get the month try
=TEXT(A1,"mmmm")
and then in A3
=INDIRECT(A2&"!A1")
or you can cut out A2 altogether and use just
=INDIRECT(TEXT(A1,"mmmm")&"!A1")
Let say cell A1 has year
cell B1 has month
In cell C1 I want the number of days of month given in cell B1 in the year A1
For example: If A1=2016, B1=2, now C1 should return the number of days in February 2016.
What I have tried
In C1
=DAY(DATE(YEAR(A1),MONTH(B1)+1,))
But this does not work
I'd be grateful for a solution.
Consider:
=DATE(A1,B1+1,1)-DATE(A1,B1,1)
Or you may try this...
=DAY(EOMONTH(DATE(A1,B1,1),0))
Less transparent but this will also work
=42-DAY(DATE(A1,B1,42))
format as general
Excel have a lot of functions that are unknown for most users. EOMONTH is the function you need in your case. It returns the last date of the month for a given date.
Consider you have a cell A1 with TODAY function and you want the last date of the month. In B1 you put:
=EOMONTH("A1",0)
So in B1 will show 30/04/2017 (for those whose date format is dd/mm/yyyy).
I have a dropdown box with the following listed values:
January
February
March
April
May
June
July
August
September
October
November
December
Let's say a user selects 'January from my list:
I have a cell, let's call it Cell B1 and in it i have this formula
=A1
This produces 'January' in cell B1.
However in cell C1, i need to be able to +1 to which ever month is shown in Cell B1.
So if A1 = January, then B1 also = January. But C1 needs to equal February for example.
I have tried simply doing this formula in C1:
=B1 + 1
But because i need my month to be in text rather than number, this won't work and shows #Value error.
Please can someone show me how to overcome this?
You could use:
=TEXT(DATE(YEAR(NOW()),MONTH(DATEVALUE("01-"&A1&"-"&YEAR(NOW())))+1,1),"mmmm")
Select Cell B1. In cell format, select custom format and type : mmmm
then just drag the corner of this cell (like you would do to extend a formula) over cell C1 and it will display the next month.
I need to calculate Last working day of the Week (Friday) for any date which is given in the excel sheet... Example:: if my date is given as 09-March-2016 the last working day would be 11-March-2016, similarly if my date in Excel cell is 01-March-2016 the Last working day would be 04-March-2016, Can Any one help me with the formula so that I can work further pleaseeeeeeeee... really need your help team :)
In A1 Cell
01-03-2016
In B1 Cell
=A1-WEEKDAY(A1,3)+IF(WEEKDAY(A1,3)>4,11,4)
A1 Cell = Your date (you need last working day in this week)
B1 Cell = A1+(6-WEEKDAY(A1)) - result (in case that friday is last working date)
NOTICE: B1 must be formated as date!