Convert date column - excel

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.

Related

SUMIF using named array consisting of non-adjacent columns

Good morning!
I am trying to create a dynamic SUMIF by using a named array containing data in non-adjancent columns.
The situation is as follows:
I have a file with monthly data, where the columns are labelled as:
Jan 2010, Feb 2010, (...), Dec 2010, FY 2010 (...) Jan 2020, Feb 2020, (...), Dec 2020, FY 2020
I want to sum only the monthly data (Jan 2010, Feb 2010... Dec 2010, Jan 2011, Feb 2011, etc) and exclude the data in the FY column (FY 2010, FY 2011, etc etc)
I have named the array of monthly data that interests me as a range ("relevant_monthly_data")
I am looking at individual rows of data that interest me ("country_range"). Note that the country_range consists of only one column with all the countries. It has the same number of rows as "relevant_monthly_data".
The formula that I am using only works for the first set of adjacent columns (Jan-Dec 2010), but doesn't capture Jan-Dec 2011, 2012... all the way through to 2020 even though they are all part of the named array).
=SUM(INDEX(relevant_monthly_data,MATCH("Guatemala",country_range,0),))
Could you please help me?
I am sure it is a simple question, but I somehow cannot figure out how to sum this range beyond 2010 monthly entries...
Thank you in advance for your help!

Excel custom format not kept after selection from list

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?

Excel Running Total if data in current month

I am trying to write a formula in Excel that will compare 2015 totals to 2016 totals and projections. If there is a value in the rows for January, February, March and April, I want the 2015 sum of those same months. Then the same for the projected
Screen capture of excel file
I like to use SUMPRODUCT() for something like this:
Projected:
=SUMPRODUCT(($B$5:$B$16<>"")*$A$5:$A$16)
Actual:
=SUMPRODUCT(($B$5:$B$16<>"")*$D$5:$D$16)

countif adding up how many are in a certain month

I am trying to get a formula that counts up how many cells contain this month and how many cell contain < than current month eg: in a column
March 2015
January 2016
April 2016
May 2016
May 2016
May 2016
June 2016
And then have a cell at the bottom that tells me 3 for May and 3 out of date
Assuming your data were in column A and you had 15 points, then the following two formulae should work.
Number of cells in the current month:
=COUNTIF(A1:A15, "5/1/2016")
Number of cells before the current month:
=COUNTIF(A1:A15,"<5/1/2016")

Weekday/ work day excel dates

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"))

Resources