In an excel sheet I've created some custom dates. These dates are calculated from a formula used to fetch a series of days from a given week of the year.
The custom format I applied is ddd, dd mmmm a.m. and ddd, dd mmmm p.m. and they are listed in this way:
day1 a.m.
day1 p.m.
day2 a.m.
day2 p.m.
and so on...
Example:
Mon, 21 January 2020 a.m.
Mon, 21 January 2020 p.m.
Tue, 22 January 2020 a.m.
Tue, 22 January 2020 p.m.
These dates are then used in the main sheet of the document, in a drop-down list, so that the user can select the relevant date.
But while the custom format is displayed correctly in the list, it is not when a date is finally selected and it's automatically changed/converted to a standard date format.
Practically speaking, in the drop-down list I see ddd, dd mmmm a.m. (or p.m.) but when I select a date I see ddd, dd mm yy
I can't put a custom format to the cells because I don't know if the user will chose "a.m." or "p.m" and I can't convert to simple text as well because I will get the date in numbers (result from the formula).
I've also tried with conditional formatting but it doesn't work (or I'm using the wrong code...)
So my temporary workaround is erasing the formula on the cells and type manually the dates so they're seen as simple text and not converted, but of course it's not what I want...
Any suggestion on how to keep the custom date after selection from the list?
Related
In a excel sheet range A1:A12, I need months like:
Jan 2020 to Dec 2020 for current year.
and Jan 2021 to Dec 2021 for next year. and so on. Automatically.
I google it but did not find any suitable result.
Plz help me and ignore my weak English and grammar.
Thank You.
Let's say you want a real date, using the 1st of each month (you can then format the cells to just show mmm yyyy or whatever other format you like). In your first cell enter:
=DATE(YEAR(TODAY()),ROWS($A$1:$A1),1)
and copy it down. If you actually want the month as text, just wrap that in the TEXT function:
=TEXT(DATE(YEAR(TODAY()),ROWS($A$1:$A1),1),"mmm yyyy")
Note that the DATE function will happily adjust the year if you pass a month number greater than 12.
Use below formula-
=TEXT(DATE(2020+INT(ROW()/13),MOD(ROW(),13)+INT(ROW()/13),1),"mmm-yyyy")
To get This using =TODAY() function you have to use 2 cells.
Let's use A1 and B1 as the 2 cells.
In A1 you will display today's dat as dd/mm/yyyy
=TODAY() type this in A1
In B1 you will convert it to month and year.
=TEXT(A1,"mmm-yyyy") type this in B1
But using this method you can only get this month.
I am trying to figure out how to use Conditional Formatting to setup so any dates under "Performed" regardless of before or after "Due" date will show specific formatting using NETWORKDAYS. Any dates of over 3 or more days (both plus and minus of "Due") will be red. And any dates of 2 or less days (both plus and minus of "Due") will be green.
I require these to be working/week days where if the "Due" date is e.g. 02 Nov 2020, and the performed date is 03 Nov 2020 (under 2 days) will be green. But if performed on the 28 Oct 2020 (as it is over 2 working days) will be formatted red.
Excel showing image of spreadsheet
I have currently used the following codes:
=NETWORKDAYS($D$5,$E$5)<3
=NETWORKDAYS($D$5,$E$5)>3
The first for the green, and the second for red.
Any help will be helpful.
Try using absolute value in your formula? For example:
=abs(NETWORKDAYS($D$5,$E$5))>3
I have data in an excel sheet. There I have a column with date values like this.
13 May 2012
27 August 2012
21 June 2012
18 March 2012
16 November 2011
15 December 2011
Is there a way to convert it to a format like this? 1998-12-25
I am assuming your dates are stored as strings. If one of your data is in cell A1, use in B1
=DATEVALUE(LEFT(A1,FIND(" ",A1)-1)&" "&LEFT(MID(A1,FIND(" ",A1)+1,FIND(" ",RIGHT(A1,LEN(A1)-FIND(" ",A1)))-1),3)&" "&RIGHT(A1,4))
Then format B1 as Custom, Type: yyyy-mm-dd.
Shorter formulas are possible, in particular if you can assume that the day will always have two digits (e.g., 01, and never 1).
If your data are stored as numeric instead of string, then simply apply the formatting procedure described.
I have set as dates in row A all the Sundays of the year from A7-A60. I would like a conditional format so the current Sunday will be always highlighted whenever one opens that excel file.
I've tried setting that with WEEKDAY but could get it working.
I assume that by "current Sunday" you mean the one just passed, so on Saturday 3rd Jan the previous Sunday (28th December 2014) will be highlighted.....but during the period from 4th January to 10th January 2015 the Sunday 4th January 2015 date will be highlighted ...and so on through the year
To do that select the whole range and use this formula in conditional formatting:
=A7=TODAY()-WEEKDAY(TODAY())+1
That works because the formula =TODAY()-WEEKDAY(TODAY())+1 always gives you the previous Sunday, so it's sufficient to see if A7 matches that date.
As your range only contains Sundays this version will also work in this case
=(A7<=TODAY())*(A7>TODAY()-7)
.....because that will highlight any date in the current week
How do you do this in excel without entering it all manually for the rest of the year? Its work days.
JANUARY
03 04 05 06 09 10 11 12 13
T W T F M T W T F
So for January I need all the work days in numbers and in days in text like below:
For January the first working day is 03 and that day is T(Tuesday). I need a formula to show on the first column 03 and then the 2nd row will show T for tuesday. I want this to continue for the rest of January.
January
03
T
If you don't mind using Analysis ToolPak functions you can try this approach:
First you need a list of holiday dates, e.g. 2nd Jan 2012, 6th April 2012. List these one per cell, perhaps in another worksheet and name that list holidays.
In A1 put the first of the month you want to see, e.g. 1/1/2012 (if you want it to default to current month always then use this formula =EOMONTH(TODAY(),-1)+1) - format that cell as mmm-yy
Now use this formula in A3 copied across to W3
=IF(WORKDAY($A1-1,COLUMNS($A3:A3),holidays)>EOMONTH($A1,0),"",WORKDAY($A1-1,COLUMNS($A3:A3),holidays))
format cells with custom format dd
and then in A4 use this formula copied across to W4
=LEFT(TEXT(A3,"ddd"))