Excel data cleaning interview question
Extra spaces, names in the wrong order, numbers stored as text and dates that aren't dates: the cleaning task interviewers love, solved with formulas, and a sheet that grades yours.
DATE builds a date from a year, a month and a day: =DATE(2026,3,9) is 9 March 2026. It's the safe way to make a date in a formula, because it means the same date on every computer, whatever its date settings.
Available in every version of Excel, Excel for the web and Google Sheets=DATE(year, month, day)| Argument | Required | What it means |
|---|---|---|
year | Yes | The year, in full: 2026. Excel adds 1900 to a year from 0 to 1899, so 26 means 1926. Below 0, or from 10000 up, DATE returns #NUM!. |
month | Yes | 1 to 12. A bigger number runs on into the years after, so 14 is February of the next year; 0 or less goes back, so 0 is December of the year before. |
day | Yes | 1 to 31. A day past the end of the month runs on into the months after; 0 is the last day of the month before, and below 0 goes further back. |
Exports often split a date into a year, a month and a day. DATE puts them back together as a real date you can sort, filter and subtract.
| Row | A | B | C | D | E |
|---|---|---|---|---|---|
| 1 | Year | Month | Day | Date | |
| 2 | 2026 | 3 | 9 | 9 Mar 2026 |
=DATE(A2,B2,C2) → 9 Mar 2026YEAR and MONTH take A2 apart, and DATE rebuilds it with the day set to 1.
| Row | A | B |
|---|---|---|
| 1 | Date | Month starts |
| 2 | 27 Aug 2026 | 1 Aug 2026 |
=DATE(YEAR(A2),MONTH(A2),1) → 1 Aug 2026Day 0 of March is the day before 1 March: the last day of February. EOMONTH does the same in one step.
| Row | A | B |
|---|---|---|
| 1 | Date | Month ends |
| 2 | 10 Feb 2026 | 28 Feb 2026 |
=DATE(YEAR(A2),MONTH(A2)+1,0) → 28 Feb 2026November plus three months is month 14 of 2026, which DATE carries over into February 2027.
| Row | A | B | C |
|---|---|---|---|
| 1 | Start | Months | Review |
| 2 | 15 Nov 2026 | 3 | 15 Feb 2027 |
=DATE(YEAR(A2),MONTH(A2)+B2,DAY(A2)) → 15 Feb 2027New data, so you can't copy the answer above. We check the number your formula returns, then change the data to make sure it still holds.
Your task: A system exported the date in A2 as one number: year, month, day. In B2, turn it into a real date.
Graded live| Row | A | B |
|---|---|---|
| 1 | Imported | Date |
| 2 | 20260309 |
Write the formula in the bar above, then press Check or Enter.
The year is LEFT(A2,4), the month MID(A2,5,2) and the day RIGHT(A2,2). DATE takes them in that order.
=DATE(LEFT(A2,4),MID(A2,5,2),RIGHT(A2,2)) Any formula that returns the same result passes.
A date is a whole number of days. In the 1900 date system, the one Excel uses by default, 1 is 1 January 1900 and =DATE(2026,1,1) is 46023. That’s why subtracting two dates gives the days between them, and why adding 7 to a date gives the same weekday a week later. A time is the fraction of a day after the point: 0.5 is noon.
A workbook can be switched to the 1904 date system (on Windows, File > Options > Advanced), the default in older versions of Excel for Mac. It counts from 1 January 1904, so every date’s serial number is 1,462 lower, and dates copied between the two kinds of workbook move by four years and a day.
DATE is the safest way to put a date into a formula. A typed date such as “3/9/2026” is read by the computer’s own date settings, so it can mean March on one computer and September on another, and if it doesn’t fit them it stays text.
Excel counts 29 February 1900 as a real day, serial number 60, though 1900 wasn’t a leap year. Lotus 1-2-3 made that mistake first, and Excel kept it so files could move between the two. In the 1900 date system, every date from 1 March 1900 on is right. Before it, WEEKDAY gives the wrong day of the week: Excel calls 1 January 1900 a Sunday, but it was a Monday.
Excel stores dates as numbers, and the cell has no date format. Format it as a date and the number shows as the date it stands for.
1 January 1900, which is serial number 1 in the 1900 date system, Excel's default. An earlier date can't be stored as a date; typed in, it stays text. A workbook set to the 1904 date system starts on 1 January 1904 instead.
Excel treats it as one, although it wasn't: it counts a 29 February 1900. Microsoft kept that for compatibility with Lotus 1-2-3. Only dates before 1 March 1900 are affected.
=TODAY() returns today's date and changes every day. Press Ctrl+; to type today's date as a value that stays put.
Worked problems with practice sheets.
Extra spaces, names in the wrong order, numbers stored as text and dates that aren't dates: the cleaning task interviewers love, solved with formulas, and a sheet that grades yours.
Invoices due at the end of next month, and the working days a client has to pay: the date task interviewers set, solved with EOMONTH and NETWORKDAYS, plus a sheet that grades yours.
#NUM! means a calculation has no valid answer: an IRR with no rate to find, a square root of a negative. Each cause and its fix, with a practice sheet.
Practise DATE and the functions around it in a live grid that grades your result and explains your mistakes.
Runs in your browser · Graded on your result · No install