TECHNOLOGIESTieInn Technologies

Text and date functions

Excel · 17 questions

Short notes

Key idea

Text functions clean and reshape labels; date functions turn dates into periods and gaps. Excel stores a date as a whole number of days, which is why you can subtract dates.

Syntax

=TRIM(A2)   =PROPER(A2)   =UPPER(A2)
=LEFT(A2,3) =RIGHT(A2,4)  =MID(A2,2,5)  =LEN(A2)
=A2 & " " & B2       =TEXTJOIN(", ", TRUE, A2:C2)
=YEAR(D2)  =MONTH(D2)  =TEXT(D2, "mmm-yyyy")
=E2 - D2             (days between)
=EOMONTH(D2, 0)  =NETWORKDAYS(D2, E2)  =TODAY()

Example

Days to ship: =E2-D2, formatted as a number. Month label for a pivot: =TEXT(D2, "yyyy-mm"), which sorts correctly, unlike "Mar-2024".

Traps

  • Dates typed as text (left-aligned) don't calculate; convert with DATEVALUE or Text to Columns.
  • Day-first vs month-first: 03/04/2024 can mean 3 April or 4 March depending on the regional setting.
  • TEXT returns text, so its result can't be used in date maths afterwards.
  • TODAY() changes every day, so saved results shift when the file is reopened.

Want the full lesson with step-by-step examples, a project and a certificate? Excel course, ₹120 →

Questions

5 free questions
5 questions

    Text and date functions

  1. Question 1easy

    A2 contains TN-600001. What does this return?

    =MID(A2, 4, 3)
  2. Text and date functions

  3. Question 2medium

    B2 contains 25-Feb-2024 and C2 contains 2-Mar-2024, both as real dates. What does this return?

    =C2-B2
  4. Text and date functions

  5. Question 3easy

    A2 contains " priya SHARMA ". Which formula gives "Priya Sharma"?

  6. Text and date functions

  7. Question 4medium

    Why can you subtract one date cell from another in Excel?

  8. Text and date functions

  9. Question 5easy

    A2 contains the text Chennai (with one space at the end). What does this return?

    =LEN(A2)

12 more questions on this topic, with hints, and tests

Sign up free for 21 days of every question and test.