Skip to content
Free Excel Tutorials
  • Home
  • Excel For Beginners
  • Excel Intermediate
  • Advanced Excel For Experts

Data Analysis

  • How to create Checklist in Excel
  • How To Create Frequency Distribution in Excel
  • How to count table rows in Excel
  • How to Create Area Chart in Excel
  • How to Create Column Chart in Excel

References

  • How to create dynamic named range with OFFSET in Excel
  • How to use Excel ROWS Function
  • How to get last column number in range in Excel
  • Convert text string to valid reference in Excel using Indirect function
  • Left Lookup in Excel

Data Validations

  • Excel Data validation date in next 30 days
  • How To Create Drop-down List in Excel
  • Excel Data validation number multiple 100
  • Excel Data validation must not contain
  • Excel Data validation specific characters only

Category: Date and Time Functions

Excel Date and Time Functions return a dynamic date or time in a cell.

Display Days in month in Excel

by

This tutorial shows how to Display Days in month in Excel using example below. To get the number of days in a given month from a date, you can use a formula based on the EOMONTH and DAY functions. Formula =DAY(EOMONTH(date,0)) Explanation In the example shown, the formula in cell B5 is: =DAY(EOMONTH(B5,0)) How this …

Continue Reading

How to calculate project start date based on end date in Excel

by

To calculate a project start date or custom date based on an end date and duration in days, you can use the WORKDAY function. Note: WORKDAY function does not count the start date as a workday. Formula =WORKDAY(start,-days,holidays) Explanation In the example shown, the formula in E5 is: =WORKDAY(C5,-D5,holidays) where “holidays” is the named range G5:G9. How …

Continue Reading

How to calculate future date say 6 months ahead in Excel

by

— Next business day 6 months in future To get a date 6 months in the future, on the next work day, you can use a formula based on the WORKDAY function, with help from EDATE. Formula =WORKDAY(EDATE(date,6)-1,1,holidays) Explanation In the example shown, the formula in C6 is =WORKDAY(EDATE(B6,6)-1,1,B9:B11) How this formula works Working from …

Continue Reading

Count holidays between two dates in Excel

by

This tutorial shows how to Count holidays between two dates in Excel using example below. To count holidays that occur between two dates, you can use the SUMPRODUCT function.  Formula =SUMPRODUCT((holidays>=start)*(holidays<=end)) Explanation In the example shown, the formula in F8 is: =SUMPRODUCT((B4:B12>=F5)*(B4:B12<=F6)) How this formula works This formula uses two expressions in a single array …

Continue Reading

How to calculate quarter from date in Excel

by

If you want to calculate the quarter (i.e. 1,2,3,4) from a date, you can use the ROUNDUP function together with MONTH. Formula =ROUNDUP(MONTH(date)/3,0) Explanation In the example shown, the formula in cell C5 is: =ROUNDUP(MONTH(B5)/3,0) How this formula works In this case, the formula first extracts the month as a number between 1-12, then divides …

Continue Reading

How to calculate Next working/business day in Excel

by

To get the next working day, or next business day, you can use the WORKDAY function. Formula =WORKDAY(date,1,holidays) Explanation In the example shown, the formula in C4 is: =WORKDAY(B4,1,holidays) How this formula works The WORKDAY formula is fully automatic. Given a date and days, it will add days to the date, taking into account weekends …

Continue Reading

Convert date string to date time in Excel

by

This tutorial shows how to Convert date string to date time in Excel using example below. To convert a date string to a datetime (date with time) you can parse the text into separate components then build a proper datetime. When date information from other systems is pasted or imported to Excel, it may not …

Continue Reading

Count day of week between dates in Excel

by

This tutorial shows how to Count day of week between dates in Excel using example below. To count the number of Mondays, Fridays, Sundays, etc. between two dates you can use an array formula that uses several functions: SUMPRODUCT, WEEKDAY, ROW, and INDIRECT.  Formula =SUMPRODUCT(–(WEEKDAY(ROW(INDIRECT(date1&”:”&date2)))=dow)) Explanation In the example shown, the formula in cell E6 …

Continue Reading

How to get same date next month or previous month in Excel

by

To get the same date next month from a given date, you can use the EDATE function. Formula =EDATE(date,1) Explanation In the example shown, the formula in cell B5 is: =EDATE(B5,1) How this formula works EDATE can get the “same date” in the future or past, based on the number of months supplied. When 1 …

Continue Reading

Pad week numbers with zeros in Excel

by

To pad week numbers (or any number) with zeros using a formula, you can use the TEXT function. Formula =TEXT(WEEKNUM(date,type),”00″) Explanation In the example show, D5 contains this formula: =TEXT(WEEKNUM(B5,21),”00″) Which returns the string “07”. How this formula works The TEXT function can apply number formats of any kind, including currency, date, percentage, etc. By …

Continue Reading

Convert date to Julian format in Excel

by

This tutorial shows how to Convert date to Julian format in Excel using example below. If you need to convert a date to a Julian date format in Excel, you can do so by building a formula that uses the TEXT, YEAR, and DATE functions. Formula =YEAR(date)&TEXT(date-DATE(YEAR(date),1,0),”000″) Explanation Background “Julian date format” refers to a …

Continue Reading

Count dates in current month in Excel

by

This tutorial shows how to Count dates in current month in Excel using example below. To count dates in the current month, you can use a formula based on the COUNTIFS or SUMPRODUCT function as explained below. Formula =COUNTIFS(range,”>=”&EOMONTH(TODAY(),-1)+1, range,”<“&EOMONTH(TODAY(),0)+1) Explanation In the example shown above, the formula in E7 is: =COUNTIFS(dates,”>=”&EOMONTH(TODAY(), -1)+1,dates,”<“&EOMONTH(TODAY(),0)+1) Where “dates” …

Continue Reading

How to get same date next year or previous year in Excel

by

To get the same date next year from a given date, you can use the EDATE function. Formula =EDATE(date,12) Explanation In the example shown, the formula in cell B5 is: =EDATE(B5,12) EDATE can get the “same date” in the future or past, based on the number of months supplied. When 12 is given for months, …

Continue Reading

Sum race time splits in Excel

by

If you need to add up (sum) up race time splits that are some combination of hours, minutes, and seconds, you can simply use the SUM function. However, you must take care to enter times with the right syntax and use a suitable time format to display results, as explained below. Formula =SUM(range) Explanation The …

Continue Reading

Convert date to month and year in Excel

by

This tutorial shows how to Convert date to month and year in Excel using example below. To convert a normal Excel date into yyyymm format (e.g. 9/1/2017 > 201709), you can use the TEXT function. Formula =TEXT(date,”yyyymm”) Explanation In the example shown, the formula in C6 is: =TEXT(B6,”yyyymm”) How this formula works The TEXT function …

Continue Reading

Get week number from date in Excel

by

If you need to get the week number from the day from a date, you can use the WEEKNUM function. The date must be in a form that Excel recognizes as a valid date. Note: The WEEKNUM function takes two arguments, a date, and, optionally, an argument called return_type, which controls the scheme used to calculate …

Continue Reading

Two ways to sum time over 30 minutes in Excel

by

To sum the total amount of time over 30 minutes, given a set of times that represent duration, you can use the SUMPRODUCT and TIME functions. Alternatively, use SUMIFS and COUNTIFS functions. Formula =SUMPRODUCT((range-TIME(0,30,0))*(range>TIME(0,30,0))) Explanation  In the example shown, the formula in G5 is: =SUMPRODUCT((times-TIME(0,30,0))*(times>TIME(0,30,0))) where “times” is the named range C5:C14. How this formula works This formula …

Continue Reading

Convert date to text in Excel

by

This tutorial shows how to Convert date to text in Excel using example below. If you need to convert dates to text (i.e. date to string conversion) , you can use the TEXT function. The TEXT function can use patterns like “dd/mm/yyyy”, “yyyy-mm-dd”, etc. to convert a valid date to a text value. See table below for …

Continue Reading

Get age from birthday in Excel

by

This tutorial shows how to get age from birthday in Excel using example below. If you need to calculate a person’s age from their birth date, you can do so with the YEARFRAC, INT, and TODAY functions. As stated in the formula below, birthdate is the person’s birthday with year, and TODAY supplies the date …

Continue Reading

Get work hours between dates in Excel

by

To calculate the total number of work hours between two dates, you can use a formula based on the NETWORKDAYS function, where “start” is the start date, “end” is the end date, “holidays” is a range that includes dates, and “hours” is the number of work hours in a workday. Formula =NETWORKDAYS(start,end,holidays)*hours Explanation In the …

Continue Reading

Calculate time difference in hours as decimal value in Excel

by

To get the duration between two times in as decimal hour (i.e. 3 hrs, 4.5 hrs, 8 hrs, etc.) you can use a formula based on the MOD function. Formula =MOD(end-start,1)*24 Explanation In the example shown, the formula in D5 is: =MOD(B2-A2,1)*24 Excel hours In Excel, one day is the number 1, so 1 hour …

Continue Reading

Convert decimal hours to Excel time

by

This tutorial shows how to Convert decimal hours to Excel time using example below. To convert hours in decimal format to a value Excel recognizes as time, divide by 24. Formula =hours/24 Explanation In the example shown the formula in C5 is: =B5/24 which returns 0.04167, the equivalent of 1 hours. Cell D6 shows the …

Continue Reading

Get work hours between dates and times in Excel

by

To calculate total work hours between two dates and times, you can use a formula based on the NETWORKDAYS function. Formula =(NETWORKDAYS(start,end)-1)*(upper-lower) +IF(NETWORKDAYS(end,end),MEDIAN (MOD(end,1),upper,lower),upper) -MEDIAN(NETWORKDAYS(start,start) *MOD(start,1),upper,lower) Explanation In the example shown, E5 contains this formula: =(NETWORKDAYS(B5,C5)-1)*(upper-lower) +IF(NETWORKDAYS(C5,C5),MEDIAN (MOD(C5,1),upper,lower),upper) -MEDIAN(NETWORKDAYS(B5,B5) *MOD(B5,1),upper,lower) where “lower” is the named range H5 and “upper” is the named range H6. How this formula …

Continue Reading

Calculate total hours that fall between two times in Excel

by

Case study You have a start time and an end time, and you want to know how many of the hours in between these two times overlap another time period in the day. For example, you want to know how many hours fall between 8:00 AM and 5:00 PM, or 7:00 PM to 7:00 AM, etc. …

Continue Reading

Convert decimal minutes to Excel time

by

This tutorial shows how to Convert decimal minutes to Excel time using example below. To convert minutes in decimal format to a proper Excel time, divide by 1440. Formula =minutes/1440 Explanation In the example shown, the formula in C6 is: =B6/1440 Because B6 contains 60 (representing 360 minutes) the result is 60/1440 = 0.04167, since …

Continue Reading

How to calculate most recent day of week in Excel

by

If you want to find the most recent Wednesday, or Saturday, or Monday, given a specific start date, you can use a formula that uses the MOD function. Formula =date-MOD(date-dow,7) Note: If the the date has the same day of week, date will be returned. Explanation   Formulas that use the concept of “day of …

Continue Reading

Get work hours between dates custom schedule in Excel

by

To calculate work hours between two dates with a custom schedule, you can use a formula based on the WEEKDAY and SUMPRODUCT functions, with help from ROW, INDIRECT, and MID. Formula =SUMPRODUCT(MID(schedule,WEEKDAY (ROW(INDIRECT(start&”:”&end))),1)*ISNA (MATCH(ROW(INDIRECT(start&”:”&end)),holidays,0))) Explanation In the example shown, the formula in F8 is: =SUMPRODUCT(MID(D6,WEEKDAY(ROW (INDIRECT(B6&”:”&C6))),1)*ISNA(MATCH (ROW(INDIRECT(B6&”:”&C6)),holidays,0))) Which returns 36 hours, based on a custom …

Continue Reading

How to calculate workdays per month in Excel

by

To calculate workdays per month, use the EOMONTH function together with the NETWORKDAYS function. Formula =NETWORKDAYS(date,EOMONTH(date,0),holidays) Explanation In the example shown, the formula in C4 is: =NETWORKDAYS(B4,EOMONTH(B4,0),holidays) Where “holidays” is the named range E3:E13. How this formula works First, it’s important to understand that the values in the Month column (B) are actual dates, formatted with the …

Continue Reading

Convert decimal seconds to Excel time

by

This tutorial shows how to Convert decimal seconds to Excel time  using example below. To convert seconds in decimal format to a proper Excel time, divide by 86400. Formula =seconds/86400 Explanation In the example shown, the formula in C6 is: =B6/86400 To display the result as time, apply a time format. Column D shows the …

Continue Reading

How to calculate next day of week in Excel

by

To return the next specific day of week (i.e. the next Wednesday, or Friday, or Monday) with a given start date, you can use a formula based on the WEEKDAY function. Formula =date+7-WEEKDAY(date+7-dow) Explanation  In the example shown, the formula in D6 is: =B6+7-WEEKDAY(B6+7-2) Where B6 contains the date Friday, January 16, 2015, and 2 represents Monday, the “dow”. …

Continue Reading

How to get workdays between dates in Excel

by

To calculate the number of workdays between two dates, you can use the NETWORKDAYS function. NETWORKDAYS automatically excludes weekends, and it can optionally exclude a custom list of holidays as well. Formula =NETWORKDAYS(start_date,end_date,holidays) Note that NETWORKDAYS includes both the start and end dates in the calculation if they are workdays. Explanation For example, if you …

Continue Reading

How to calculate working days left in month in Excel

by

To calculate the number of workdays remaining in a month, you can use the NETWORKDAYS function. NETWORKDAYS automatically excludes weekends, and it can optionally exclude a custom list of holidays as well. Formula =NETWORKDAYS(date,EOMONTH(date,0),holidays) Explanation In the example shown, the formula in C5 is: =NETWORKDAYS(B5,EOMONTH(B5,0),E5:E14) Were B5 contains a current date, and the range E5:E14 contains …

Continue Reading

Convert Excel time to decimal hours in Excel

by

This tutorial shows how to Convert Excel time to decimal hours  using example below. To convert a valid Excel time into decimal hours, simply multiply by 24.  Formula =A1*24 Explanation In the example shown, the formula in C6 is: =B6*24 which returns a value of 1. How this formula works In the Excel time system, …

Continue Reading

How to calculate next scheduled event in Excel

by

To get the next scheduled event from a list of events with dates, you can use an array formula based on the MIN and TODAY functions to find the next date, and INDEX and MATCH  to display the event on that date. Formula {=MIN(IF((range>=TODAY()),range))} Note: this is an array formula and must be entered with Control + …

Continue Reading

How to get year from date in Excel

by

If you need to extract the year from a date, you can use the YEAR function. Formula =YEAR(date) Explanation In the generic form of the formula above, the date  must be in a form that Excel recognizes as a valid date. How the formula works The YEAR function takes just one argument, the date from …

Continue Reading

How to determine year is a leap year in Excel

by

If you want to test whether the year of a certain date is a leap year, you can use a formula that uses the MONTH, YEAR, and DATE functions. Formula =MONTH(DATE(YEAR(date),2,29))=2 Explanation In the example shown, the formula in cell C5 is: =MONTH(DATE(YEAR(B5),2,29))=2 How the formula works The core of this formula is the DATE …

Continue Reading

Convert Excel time to decimal minutes

by

This tutorial shows how to Convert Excel time to decimal minutes using example below. To convert a valid Excel time into decimal minutes, you can multiply by 1440.  Formula =A1*1440 Explanation In the example shown, the formula in C6 is: =B6*1440 which returns a value of 30. How this formula works In the Excel time system, …

Continue Reading

How to calculate nth day of week in month in Excel

by

To get the nth day if week in a month (i.e. the first Tuesday, third Tuesday, forth Thursday, etc.) you can use a formula based on the DAY and WEEKDAY functions. Formula =date-DAY(date)+1+n*7-WEEKDAY(date-DAY(date)+8-dow) Note:  Day of week is abbreviated “dow” in the generic form of the formula. This is a number between 1 (Sunday) and 7 …

Continue Reading

Roll back weekday to Friday base on a particular date in Excel

by

Case study: If Monday, roll back to Friday To check the weekday of a date, and roll back to Friday when the date is a Monday, you can use the IF and WEEKDAY functions. Formula =IF(WEEKDAY(date)=2,date-3,date) Explanation In the example shown, the formula in C5 is =IF(WEEKDAY(B5)=2,B5-3,B5) How this formula works The WEEKDAY function returns …

Continue Reading

Series of dates by day

by

This tutorials shows how to generates Series of dates increment by day from a single start date in Excel. If you need to generate a dynamic series of dates with a formula that increase by one day from a single start date, you can do so a very simple formula that simply adds 1 to each …

Continue Reading

Posts navigation

  • Previous
  • 1
  • 2
  • 3
  • 4
  • Next

Learn Basic Excel

Ribbon
Workbook
Worksheets
Format Cells
Find & Select
Sort & Filter
Templates
Print
Share
Protect
Keyboard Shortcuts

Categories

  • Charts
  • Data Analysis
  • Data Validation
  • Excel Functions
    • Cube Functions
    • Database Functions
    • Date and Time Functions
    • Engineering Functions
    • Financial Functions
    • Information Functions
    • Logical Functions
    • Lookup and Reference Functions
    • Math and Trig Functions
    • Statistical Functions
    • Text Functions
    • Web Functions
  • Excel VBA
  • Excel Video Tutorials
  • Formatting
  • Grouping
  • Others

Logical Functions

  • IF, AND, OR and NOT Functions Examples in Excel
  • OR function Examples in Excel
  • XOR function: Description, Usage, Syntax, Examples and Explanation
  • AND function: Description, Usage, Syntax, Examples and Explanation
  • How to use Excel XOR Function

Date Time

  • Add decimal hours to time in Excel
  • Pad week numbers with zeros in Excel
  • Get days, months, and years between dates in Excel
  • WEEKDAY function: Description, Usage, Syntax, Examples and Explanation
  • Calculate total hours that fall between two times in Excel

Grouping

  • Map text to numbers in Excel
  • How to randomly assign people to groups in Excel
  • If cell contains one of many things in Excel
  • Group times into 3 hour buckets in Excel
  • Group arbitrary text values in Excel

General

  • How to create dynamic named range with INDEX in Excel
  • Select, Insert, Rename, Move, Delete Worksheets in Excel
  • Basic text sort formula in Excel
  • Using Existing Templates in Excel
  • Subtotal by invoice number in Excel
© 2023 xlsoffice . All Right Reserved. | Teal Smiles | Abbreviations And Their Meaning