Excel formula library
Excel Tutorial
Every Excel formula in one place — search, filter by category or level, then open syntax, samples, and pitfalls. New formulas added to the library appear here automatically.
Formula list
Find any Excel formula
Filter by category — Math, Lookup, FILTER and other Dynamic Arrays, Text, Date, and more — then open a formula for syntax and examples.
- Math & Arithmetic 12
- Statistical Analysis 15
- Logical & Conditional 6
- Lookup & Reference 13
- Date & Time 17
- Text & Strings 25
- Information & Arrays 12
- Dynamic Arrays (365) 6
- Enhanced Lookup (365) 2
- Advanced Calculation (365) 6
- Text & Reshaping (365) 13
No formulas match that search or filter.
Chapter 5
Date & Time
-
47 NOW =NOW() Returns the serial number of the current date and time. Recalculates whenever the sheet is evaluated.
Syntax
=NOW()Arguments
- No arguments
- Takes no arguments. Parentheses are required.
Sample
=NOW()Result 46276.6041666667
Sample data
DownloadA B C D 2 Order Created 11-Sep-2026 14:30 Logged Volatile 3 Report Run 11-Sep-2026 14:30 Printed Volatile 4 Daily Sync 11-Sep-2026 14:30 Completed Volatile Pro tipTo insert a static non-changing timestamp that does not update, press Ctrl + Shift + ; for time or Ctrl + ; for date.
Common pitfallNOW is a volatile function that recalculates every time the sheet recalculates.
-
48 TIME =TIME(hour, minute, second) Converts hours, minutes, and seconds given as numbers to an Excel serial time fraction. Excel stores times as fractions of a 24-hour day.
Syntax
=TIME(hour, minute, second)Arguments
- hour
- A number from 0 to 32767 representing the hour.
- minute
- A number from 0 to 32767 representing the minute.
- second
- A number from 0 to 32767 representing the second.
Sample
=TIME(1, 1, 1)Result 0.0423726851851852
Sample data
DownloadA B C D 2 1 1 1 1:01:01 AM 3 14 30 00 2:30:00 PM 4 9 45 15 9:45:15 AM Pro tipValues greater than 23 for hours roll over into days (e.g. TIME(25, 0, 0) is 1:00 AM the next day).
Common pitfallMake sure your cell is formatted as Time (Format Cells -> Time) so it displays as clock time rather than a decimal.
-
49 HOUR =HOUR(serial_number) Returns the hour component of a time value as an integer from 0 to 23.
Syntax
=HOUR(serial_number)Arguments
- serial_number
- The time value containing the hour you want to find.
Sample
=HOUR(A2)Result 14
Sample data
DownloadA B C D 2 14:35:20 14 Afternoon Shift 2 PM 3 09:12:45 9 Morning Shift 9 AM 4 20:45:00 20 Evening Shift 8 PM Pro tipExcel uses 24-hour military time internally for HOUR, so 2:00 PM returns 14.
Common pitfallPassing text strings that do not recognize standard time formats throws #VALUE!.
-
50 MINUTE =MINUTE(serial_number) Returns the minute component of a time value as an integer from 0 to 59.
Syntax
=MINUTE(serial_number)Arguments
- serial_number
- The time value that contains the minute you want to find.
Sample
=MINUTE(A2)Result 29
Sample data
DownloadA B C D 2 10:29:15 29 20-30m On Time 3 09:05:00 5 0-10m Early 4 11:45:30 45 40-50m Late Pro tipTo calculate total elapsed minutes from midnight: =HOUR(A2)*60 + MINUTE(A2).
Common pitfallTime values must be valid Excel times or serial numbers; plain unstructured text will fail.
-
51 SECOND =SECOND(serial_number) Returns the second component of a time value as an integer ranging from 0 to 59.
Syntax
=SECOND(serial_number)Arguments
- serial_number
- The time value containing the second you want to extract.
Sample
=SECOND(A2)Result 45
Sample data
DownloadA B C D 2 12:30:45 45 0.521354 Exact second pulled 3 08:15:00 0 0.343750 Zero second mark 4 19:40:18 18 0.819653 Standard event Pro tipCombine HOUR, MINUTE, and SECOND to calculate total seconds elapsed: =HOUR(A2)*3600 + MINUTE(A2)*60 + SECOND(A2).
Common pitfallSeconds precision beyond integers (milliseconds) is truncated by SECOND().
-
52 DAY =DAY(serial_number) Returns the day of the month corresponding to a date as an integer from 1 to 31.
Syntax
=DAY(serial_number)Arguments
- serial_number
- The date of the day you are trying to find.
Sample
=DAY(A2)Result 10
Sample data
DownloadA B C D 2 10-Apr-2025 10 Mid-Month Cycle 1 3 01-Jan-2025 1 Month Start Cycle 1 4 28-Feb-2025 28 Month End Cycle 2 Pro tipUse DAY(EOMONTH(A2, 0)) to calculate the total number of days in the current month (28, 29, 30, or 31).
Common pitfallIf date is entered as text in an unrecognized locale format (e.g. DD/MM vs MM/DD), DAY may swap month and day.
-
53 MONTH =MONTH(serial_number) Returns the month of a date represented by a serial number. The month is given as an integer from 1 to 12.
Syntax
=MONTH(serial_number)Arguments
- serial_number
- The date of the month you are trying to find.
Sample
=MONTH(A2)Result 4
Sample data
DownloadA B C D 2 10-Apr-2025 4 April Q2 3 01-Jan-2025 1 January Q1 4 15-Aug-2025 8 August Q3 Pro tipTo get the 3-letter month name instead of a number, use =TEXT(A2, "mmm") ("Apr") or "mmmm" ("April").
Common pitfallExcel stores empty cells as date 0 (0-Jan-1900), so MONTH on an empty cell returns 1.
-
54 YEAR =YEAR(serial_number)
Syntax
=YEAR(serial_number)Arguments
- serial_number
- The date of the year you want to find.
Sample
=YEAR(A2)Result 2025
Sample data
DownloadA B C D 2 10-Apr-2025 2025 FY2025 Current 3 15-Nov-2024 2024 FY2024 Archived 4 05-Jun-2023 2023 FY2023 Audited Pro tipAlways use 4-digit years in Excel formulas to avoid century ambiguity between 1925 and 2025.
Common pitfallAn empty cell passed to YEAR returns 1900.
-
55 DATE =DATE(year, month, day) Creates a valid Excel date serial number given separate year, month, and day integers. Safe from regional formatting confusion.
Syntax
=DATE(year, month, day)Arguments
- year
- Four-digit integer representing the year.
- month
- Integer representing month (1 to 12).
- day
- Integer representing day of month (1 to 31).
Sample
=DATE(2025, 1, 1)Result 45658
Sample data
DownloadA B C D 2 2025 1 1 01-Jan-2025 3 2025 4 10 10-Apr-2025 4 2025 12 25 25-Dec-2025 Pro tipDATE handles month overflow automatically: =DATE(2025, 13, 1) cleanly returns 01-Jan-2026!
Common pitfallTwo-digit years (like 25) are interpreted according to Excel century rules (1925 vs 2025); always supply 4 digits.
-
56 DATEVALUE =DATEVALUE(date_text) Converts a date stored as text to a serial number that Excel recognizes as a date. Enables date math on imported text data.
Syntax
=DATEVALUE(date_text)Arguments
- date_text
- Text that represents a date in an Excel date format.
Sample
=DATEVALUE("01-Jan-2025")Result 45658 (01-Jan-2025)
Sample data
DownloadA B C D 2 "01-Jan-2025" 45658 01-Jan-2025 Date Serial 3 "10/04/2025" 45757 10-Apr-2025 Date Serial 4 "2025-12-31" 46022 31-Dec-2025 Date Serial Pro tipAfter using DATEVALUE, format the target cell with Short Date (Ctrl + Shift + #) to view in standard calendar format.
Common pitfallIf date_text includes time information, DATEVALUE ignores the time portion.
-
57 WEEKDAY =WEEKDAY(serial_number, [return_type]) Returns the day of the week for a specified date. Default return_type gives 1 for Sunday through 7 for Saturday.
Syntax
=WEEKDAY(serial_number, [return_type])Arguments
- serial_number
- A sequential number representing the date to evaluate.
- [return_type]
- 1: Sun(1)-Sat(7), 2: Mon(1)-Sun(7), 3: Mon(0)-Sun(6).
Sample
=WEEKDAY(A2, 1)Result 5 (Thursday)
Sample data
DownloadA B C D 2 10-Apr-2025 5 Thursday No 3 12-Apr-2025 7 Saturday Yes (Weekend) 4 13-Apr-2025 1 Sunday Yes (Weekend) Pro tipUse return_type = 2 so Monday is 1 and Sunday is 7: then the weekend test is simply =WEEKDAY(A2, 2) >= 6.
Common pitfallDefault return_type is 1 (Sunday = 1), which can cause off-by-one errors for Monday-start work environments.
-
58 WEEKNUM =WEEKNUM(serial_number, [return_type]) Returns the week number of a specific date. The week containing January 1 is designated as week 1 of that year.
Syntax
=WEEKNUM(serial_number, [return_type])Arguments
- serial_number
- The date within the week you want to find.
- [return_type]
- 1: Week begins on Sunday, 2: Week begins on Monday.
Sample
=WEEKNUM(A2, 1)Result 15
Sample data
DownloadA B C D 2 10-Apr-2025 15 Sprint 15 Q2 3 01-Jan-2025 1 Sprint 1 Q1 4 15-Aug-2025 33 Sprint 33 Q3 Pro tipFor international ISO 8601 week numbering compliance (European standard), use ISOWEEKNUM(date) or return_type 21.
Common pitfallDifferent return_type values change which week is considered Week 1 if Jan 1 falls mid-week.
-
59 NETWORKDAYS =NETWORKDAYS(start_date, end_date, [holidays]) Returns the number of whole working days between start_date and end_date. Working days exclude weekends and any specified holidays.
Syntax
=NETWORKDAYS(start_date, end_date, [holidays])Arguments
- start_date
- Start date of the time span.
- end_date
- End date of the time span.
- [holidays]
- Optional range of one or more dates to exclude from the working calendar.
Sample
=NETWORKDAYS(A2, B2, C2:C3)Result 21
Sample data
DownloadPro tipNETWORKDAYS is inclusive of both start_date and end_date if they are normal working days.
Common pitfallAssumes Saturday and Sunday are the weekend. For Middle Eastern countries (Fri/Sat), use NETWORKDAYS.INTL.
-
60 NETWORKDAYS.INTL =NETWORKDAYS.INTL(start_date, end_date, [weekend], [holidays]) Returns the number of whole workdays between two dates with custom weekend parameters.
Syntax
=NETWORKDAYS.INTL(start_date, end_date, [weekend], [holidays])Arguments
- start_date, end_date
- Dates between which the workdays are calculated.
- [weekend]
- Weekend code (e.g. 1=Sat/Sun, 11=Sunday only, 7=Fri/Sat) or a 7-character string.
- [holidays]
- Range of dates to exclude as holidays.
Sample
=NETWORKDAYS.INTL(A2, B2, 11, C2)Result 25
Sample data
DownloadA B C D 2 01-Apr-2025 30-Apr-2025 11 (Sunday only) 25 Days (6-day week) 3 01-Apr-2025 30-Apr-2025 1 (Sat & Sun) 22 Days (5-day week) 4 01-Apr-2025 30-Apr-2025 7 (Fri & Sat) 22 Days (Gulf week) Pro tipUse a 7-character binary mask for custom shifts (e.g. "0000011" represents Monday-Friday work, Sat-Sun off).
Common pitfallIn binary string masks, "1" indicates a NON-working day (weekend) and "0" indicates a working day.
-
61 WORKDAY =WORKDAY(start_date, days, [holidays]) Returns a date that is a designated number of working days ahead or behind a start date, skipping weekends and holidays.
Syntax
=WORKDAY(start_date, days, [holidays])Arguments
- start_date
- The initial date.
- days
- The number of non-weekend and non-holiday days to add (positive) or subtract (negative).
- [holidays]
- Optional range of holiday dates to skip.
Sample
=WORKDAY(A2, 10, C2:C3)Result 45672
Sample data
DownloadPro tipUse WORKDAY.INTL if your organization works 6 days a week or has non-standard weekend days.
Common pitfallRemember to format the output cell as a Date, otherwise you will see a raw 5-digit serial number like 45672.
-
62 EDATE =EDATE(start_date, months) Returns the serial number that represents the date that is the indicated number of months before or after a start date.
Syntax
=EDATE(start_date, months)Arguments
- start_date
- A date representing the starting date.
- months
- Number of months before (negative) or after (positive) start_date.
Sample
=EDATE(A2, 1)Result 45787
Sample data
DownloadA B C D 2 10-Apr-2025 1 10-May-2025 +1 Month Added 3 10-Apr-2025 6 10-Oct-2025 +6 Months Added 4 10-Apr-2025 -1 10-Mar-2025 -1 Month Subtracted Pro tipEDATE handles leap years and variable month lengths intelligently (Jan 31 + 1 month becomes Feb 28 or 29).
Common pitfallAlways format output cell as Date; unformatted cells display raw numerical serial numbers.
-
63 EOMONTH =EOMONTH(start_date, months) Returns the serial number for the last day of the month that is the indicated number of months before or after start_date.
Syntax
=EOMONTH(start_date, months)Arguments
- start_date
- The starting date.
- months
- The number of months before or after start_date. 0 = current month.
Sample
=EOMONTH(A2, 0)Result 45777
Sample data
DownloadA B C D 2 10-Apr-2025 0 30-Apr-2025 Current month end 3 10-Jan-2025 1 28-Feb-2025 Next month end (Feb) 4 15-Feb-2024 0 29-Feb-2024 Leap year handled Pro tipTo find the first day of next month: =EOMONTH(A2, 0) + 1.
Common pitfallPassing months as decimal (e.g. 1.5) will be truncated by Excel to an integer (1).
