Topics in this sectionFormula and Functions12 topics
Date and Time Functions in Spreadsheets
When you work with spreadsheets in everyday situations — such as tracking attendance at a county school, recording sales at a boma market, or scheduling deliveries along the Nile — you often need to work with dates and times. Spreadsheet programs provide special functions that make this easier. These are called date and time functions. In this study note, you will learn about the most common date and time functions and how to use them in practical situations.
The NOW() function returns the current date and time on your computer. It is useful when you want a spreadsheet to automatically show today's date and the current time.
The format is simple:
=NOW()
When you type this function into a cell and press Enter, the spreadsheet displays the current date and time, for example:
14/01/2025 08:30
The value updates automatically whenever you open the spreadsheet or make changes. This function takes no arguments — you simply type the function name with empty parentheses.
The TODAY() function is similar to NOW(), but it returns only the current date, not the time. It is useful when you need to work with dates only, such as calculating how many days have passed since a certain event.
The format is:
=TODAY()
For example, if you type =TODAY() into a cell on 14th January 2025, the spreadsheet displays:
14/01/2025
The DATEVALUE() function converts a text string that looks like a date into a serial number that the spreadsheet can use in calculations. This is useful when you have dates stored as plain text and need to perform date arithmetic.
The format is:
=DATEVALUE("date_text")
For example:
=DATEVALUE("14/01/2025")
The spreadsheet converts this text into a serial number representing that date. Once converted, you can subtract one date from another to find the number of days between them.
Worked Example
Suppose a farmer in Wau recorded that seeds were planted on 01/12/2024 and the crop was harvested on 15/02/2025. To find how many days passed between planting and harvesting, you can use:
=DATEVALUE("15/02/2025") - DATEVALUE("01/12/2024")
The result is 76 days. This type of calculation is helpful for tracking growing seasons, project timelines, or employee attendance.
The WEEKDAY() function returns a number that represents the day of the week for a given date. This is useful for scheduling, such as determining which day of the week a particular date falls on.
The format is:
=WEEKDAY(date)
By default, the function returns:
- 1 for Sunday
- 2 for Monday
- 3 for Tuesday
- 4 for Wednesday
- 5 for Thursday
- 6 for Friday
- 7 for Saturday
Worked Example
If you want to know what day of the week 25th December 2025 falls on, you can type:
=WEEKDAY("25/12/2025")
The result is 5, which means Thursday. This helps when planning market days, school activities, or community meetings.
Beyond NOW, DATEVALUE, and WEEKDAY, spreadsheets support several other date and time functions that are useful in different situations:
- YEAR() — extracts the year from a date
- MONTH() — extracts the month from a date
- DAY() — extracts the day of the month from a date
- HOUR() — extracts the hour from a time value
- MINUTE() — extracts the minutes from a time value
These functions allow you to break a date or time into its individual components, which is useful for organizing and analyzing data.
Worked Example
Suppose a clinic in Malakal records patient arrival times in column A. To find out which hour of the day has the most arrivals, you could extract the hour from each time using:
=HOUR(A2)
You can then use this information to improve staffing schedules at the clinic.
One powerful feature of spreadsheets is the ability to combine multiple functions. For example, you can use YEAR(), MONTH(), and DAY() together with mathematical operations to calculate a person's age or the length of time between two events.
Worked Example
To calculate how many months have passed between two dates in cells A1 and B1:
=(YEAR(B1)-YEAR(A1))*12 + (MONTH(B1)-MONTH(A1))
This formula finds the difference in years, multiplies by 12 to convert to months, and then adds the difference in months.
| Function | Purpose | Example Result |
|---|---|---|
| NOW() | Returns current date and time | 14/01/2025 08:30 |
| TODAY() | Returns current date | 14/01/2025 |
| DATEVALUE() | Converts text date to serial number | 45678 |
| WEEKDAY() | Returns day of week (1–7) | 5 (Thursday) |
| YEAR() | Extracts year from a date | 2025 |
| MONTH() | Extracts month from a date | 1 |
| DAY() | Extracts day from a date | 14 |
In South Sudan, date and time functions are used in many practical situations. For example, a trader at a market in Juba can use a spreadsheet to record the date and time when goods arrive and calculate how many days the goods have been in storage. Teachers at county schools can use the WEEKDAY() function to automatically identify which days are school days when preparing attendance sheets. Health workers can use TODAY() and DATEVALUE() to track how many days have passed since a patient received medicine, ensuring proper follow-up care at the clinic.
Question
What does the NOW() function return when entered into a spreadsheet cell?
Sign in to submit your answer and have it count toward your mastery.
Sign in to practiceTutor
Stuck? Ask me anything about this topic.
Sign in to ask the Sonza AI Tutor about this question.
Sign in to askDiscussions
No questions yet