Docsity
Docsity

Prepara tus exámenes
Prepara tus exámenes

Prepara tus exámenes y mejora tus resultados gracias a la gran cantidad de recursos disponibles en Docsity


Consigue puntos base para descargar
Consigue puntos base para descargar

Gana puntos ayudando a otros estudiantes o consíguelos activando un Plan Premium


Orientación Universidad
Orientación Universidad


Formulas para manipular fechas y números en Excel, Esquemas y mapas conceptuales de Informática

Este documento contiene una colección de fórmulas para manipular fechas y números en excel. Encontrarás formulas para contar únicos valores, convertir formatos de fechas, calcular días laborales en un año, extracciones de subcadenas y mucho más. Estas fórmulas pueden ser útiles para estudiantes universitarios, aprendices de excel o personas que deseen automatizar tareas en excel.

Tipo: Esquemas y mapas conceptuales

2023/2024

Subido el 11/01/2024

jhonier-eduardo-plaza-correa
jhonier-eduardo-plaza-correa 🇨🇴

1 documento

1 / 65

Toggle sidebar

Esta página no es visible en la vista previa

¡No te pierdas las partes importantes!

bg1
EXCEL Formulas
Excel 365
Prepared & presented by
Mubarak Ghaith
September 2023
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d
pf1e
pf1f
pf20
pf21
pf22
pf23
pf24
pf25
pf26
pf27
pf28
pf29
pf2a
pf2b
pf2c
pf2d
pf2e
pf2f
pf30
pf31
pf32
pf33
pf34
pf35
pf36
pf37
pf38
pf39
pf3a
pf3b
pf3c
pf3d
pf3e
pf3f
pf40
pf41

Vista previa parcial del texto

¡Descarga Formulas para manipular fechas y números en Excel y más Esquemas y mapas conceptuales en PDF de Informática solo en Docsity!

Excel 365

Prepared & presented by

Mubarak Ghaith

September 2023

Table of Contents

    1. SUM of Digits when cell Contains all Numbers
    1. SUM of Digits when cell Contains Numbers and non Numbers both
    1. A List is Unique or Not (Whether it has duplicates)
    1. Count No. of Unique Values
    1. Count No. of Unique Values Conditionally
    1. Generate Sequential Weekday names like Sun, Mon, Tue, .....,Sat
    1. Generate Sequential Month names like Jan, Feb, Mar....Dec
    1. Find Last Day of the Month
    1. Number of Days in a Month
    1. Find First Day of the Month..................................................................................................................
    1. Add Month to or Subtract Month from a Given Date
    1. Add Year to or Subtract Year from a Given Date
    1. Convert a Number to a Month Name
    1. Convert a Month Name to Number
    1. Convert a Number to Weekday Name
    1. Convert a Weekday Name to Number
    1. Financial Year Formula (e.g. 2015-16 or FY16)
    1. Converting Date to a Calendar Quarter
    1. Converting Date to a Indian Financial Year Quarter...................................................................
    1. Determine Quarter for Fiscal Year
    1. Calculate Age from Given Birthday
    1. Convert from dd/mm/yy to mm/dd/yy (DMY to MDY)
    1. Convert from mm/dd/yy to dd/mm/yy (MDY to DMY)
    1. Number to Date Format Conversion
    1. Number to Time Format Conversion.............................................................................................
    1. Convert Time to Decimal Hours, Minutes and Seconds
    1. Convert Decimal Hours, Minutes and Seconds to Time
    1. Generate a Sequence of Dates
    1. Generate a Sequence of Times
    1. How to Know if a Year is a Leap Year
    1. Last Working Day of the Month If a Date is Given
    1. First Working Day of the Month if a Date is Given
    1. Determine Number of Working Days in a Year
    1. Determine Number of Working Days in a Month
    1. How Many Mondays or any other Day of the Week between 2 Dates
    1. Find Number of Friday the 13th between Two Given Dates
    1. Calculate Next Working day if date falls on a Weekend / Holiday
    1. Calculate Previous Working day if date falls on a Weekend / Holiday
    1. Date for Nth Day of the Year
    1. Extract Date and Time from Date Timestamp
    1. First Working Day of the Year
    1. Last Working Day of the Year
    1. Convert from Excel Date (Gregorian Date) to Julian Date
    1. Convert from Julian Dates to Excel (Gregorian) Dates
    1. Convert a Number into Years and Months
    1. Find the Next Week of the Day
    1. Find the Previous Week of the Day
    1. Count Cells Starting (or Ending) with a particular String
    1. Count No. of Cells Having Numbers Only
    1. Reverse a String
    1. Reverse Number String
    1. Reverse a String of Words..................................................................................................................
    1. Reverse a Range of Cells
    1. Get First Row Number in a Range
    1. Get Last Row Number in a Range
    1. Get First Column Number in a Range
    1. Get Last Column Number in a Range
    1. Extract Unique Characters
    1. Test whether a range contains only numbers............................................................................
    1. Test whether a range contains only English alphabets
    1. Count No. of Cells which are containing only Characters
    1. Number of Characters in a String without considering blanks
    1. Number of times a character appears in a string......................................................................
    1. Count Non Numbers in a String
    1. Count Numbers in a String.................................................................................................................
    1. Count only Alphabets in a String
    1. Generate English Alphabets
    1. Convert English Alphabets to Numbers
    1. Convert Numbers to English Alphabets
    1. Extract nth Word from Front
    1. Extract nth Word from Back
    1. Extract first two words OR first n words
    1. Extract last two words OR last n words
    1. Most Frequently Occurring Value in a Range
    1. COUNTIF with OR Condition
    1. SUMIF with OR Condition
    1. COUNTIF on Filtered List
    1. SUMIF on Filtered List
    1. Extract First Name from Full Name
    1. Extract Last Name from Full Name
    1. Extract the Initial of Middle Name
    1. Extract Middle Name from Full Name
    1. Remove Middle Name in Full Name
    1. Extract Integer and Decimal Portion of a Number
    1. Maximum Times a Particular Entry Appears Consecutively
    1. Get File Name through Formula
    1. Get Workbook Name through Formula
    1. Get Sheet Name through Formula
    1. Get Workbook's Directory from Formula
    1. Perform Multi Column VLOOKUP
    1. VLOOKUP from Right to Left
    1. Case Sensitive VLOOKUP
    1. Rank within the Groups
    1. Extract Alphabets from a String
    1. Remove Alphabets from a String.....................................................................................................
    1. Extract numbers from string
    1. Remove numbers from string...........................................................................................................
    1. Roman Representation of Numbers...............................................................................................
    1. Sum Bottom N Values in a Range
    1. Sum Every Nth Row
    1. Sum Every Even Row
    1. Sum Every Odd Row
    1. Sum Top N values in a Range
    1. We have AVERAGEIF. What about MEDIANIF and MODEIF?
    1. Calculate Geometric Mean by Ignoring 0 and Negative Values
    1. Generate GL Codes............................................................................................................................
    1. Abbreviate Given Names
    1. Get Column Name for a Column Number
    1. Get Column Range for a Column Number
    1. Find the nth Largest Number when there are duplicates
    1. COUNTIF for non-contiguous range
    1. Count the Number of Words in a Cell / Range.......................................................................
    1. Numerology Sum of the Digits aka Sum the Digits till the result is a single digit
    1. Generate Sequential Numbers and Repeat them..................................................................
    1. Repeat a Number and Increment and Repeat....
    1. Generate Non Repeating Random Numbers through Formula
    1. Extract User Name from an E Mail ID
    1. Extract Domain Name from an E Mail ID
    1. Location of First Number in a String
    1. Location of Last Number in a String
    1. Find the Value of First Non Blank Cell in a Range
    1. Find First Numeric Value in a Range
    1. Find Last Numeric Value in a Range
    1. Find First non Numeric Value in a Range
    1. Find Last non Numeric Value in a Range
    1. Find Last Used Value in a Range
    1. I have data for many years but I want the sum for only last 12 months
    1. Generate a Unique List out of Duplicate Entries
    1. Financial Function - Calculate EMI.............................................................................................
    1. Financial Function - Calculate Interest Part of an EMI
    1. Financial Function - Calculate Principal Part of an EMI.....................................................
    1. Financial Function - Calculate Number of EMIs to Pay Up a Loan
    1. Financial Function - Calculate Interest Rate...........................................................................
    1. Financial Function – Calculate Compounded Interest
    1. Financial Function – Calculate Effective Interest
    1. Financial Function – Calculate CAGR and AAGR
    1. Slab Billing – Calculate Income Tax, Electricity (Utility) Bills based on Slabs
    1. LTRIM and RTRIM through Excel Formulas

1. SUM of Digits when cell Contains all Numbers If you cell contains only numbers like A1:= 7654045, then following formula can be used to find sum of digits =SUM(--MID(A1,SEQUENCE(LEN(A1)),1)) =SUMPRODUCT(--MID(A1,ROW(INDIRECT("1:"&LEN(A1))),1)) =SUM(--MID(A1,ROW(INDIRECT("1:"&LEN(A1))),1)) If A1 is blank, then to handle error, you can enclose above formulas into an IFERROR block. 2. SUM of Digits when cell Contains Numbers and non Numbers both If your cell contains non numbers apart from numbers like A1:= 76$5a4b045%d, then following formulas can be used to find sum of digits =SUM(IFERROR(--MID(A1,SEQUENCE(LEN(A1)),1),0)) =SUMPRODUCT((LEN(A1)-LEN(SUBSTITUTE(A1,ROW($1:$9),"")))*ROW($1:$9)) =SUM(IFERROR(--MID(A1,ROW(INDIRECT("1:"&LEN(A1))),1),0)) 3. A List is Unique or Not (Whether it has duplicates) Assuming, your list is in A1 to A1000. Use following formula to know if list is unique. =MAX(COUNTIF(A1:A1000,A1:A1000)) If answer is 1, then it is Unique. If answer is more than 1, it is not unique. 4. Count No. of Unique Values Use following formula to count no. of unique values - =IF(COUNTA(A1:A100)=0,0,COUNTA(UNIQUE(FILTER(A1:A100&"",A1:A100<>"")))) =SUMPRODUCT((A1:A100<>"")/COUNTIF(A1:A100,A1:A100&"")) =SUM((A1:A100<>"")/COUNTIF(A1:A100,A1:A100&"")) 5. Count No. of Unique Values Conditionally If you have data like below and you want to find the unique count for Region = “A", then you can use below formula – Mubarak G haith

=IF(COUNTIF(A2:A20,"A")=0,0,COUNTA(UNIQUE(FILTER(B2:B20,A2:A20="A"))))

=SUM(IF(FREQUENCY(IF(A2:A20<>"",IF(A2:A20="A",MATCH(B2:B20,B2:B20,0))),ROW(A

2:A20)-ROW(A2)+1),1))

If you have more number of conditions, the same can be built after A2:A20 = “A".

6. Generate Sequential Weekday names like Sun, Mon, Tue, .....,Sat For 3 characters Weekday name =TEXT(DATE(2017,1,SEQUENCE(7)),"ddd") =TEXT(DATE(2017,1,ROW($1:$7)),"ddd") (Note – Year 2017 has been used as 1-Jan-2017 was Sunday. You can use any year in place of 2017 where 1-Jan was a Sunday like year 2023) For full Weekday name, replace ddd with dddd =TEXT(DATE(2017,1,SEQUENCE(7)),"dddd") =TEXT(DATE(2017,1,ROW($1:$7)),"dddd") You can add a number if you want to show some other Weekday Name. Say, if you want to show 1 = Monday, 2 = Tuesday…….7 = Sunday, just add 1. Hence, formulas would become =TEXT(1+DATE(2017,1,SEQUENCE(7)),"ddd") =TEXT(1+DATE(2017,1,ROW($1:$7)),"ddd") Mubarak G haith

=A1-DAY(A1)+

=EOMONTH(A1,-1)+

=DATE(YEAR(A1),MONTH(A1),1)

11. Add Month to or Subtract Month from a Given Date Very often, you will have business problems where you have to add or subtract month from a given date. One scenario is calculation for EMI Date. Say, you have a date of 10/22/ 21 (MM/DD/YY) in A1 and you want to add number of months which is contained in Cell B1. The formula in this case would be =EDATE(A1,B1) [Secondary formula =DATE(YEAR(A1),MONTH(A1)+B1,DAY(A1)) ] Now, you want to subtract month which is contained in Cell B1. =EDATE(A1,-B1) [Secondary formula =DATE(YEAR(A1),MONTH(A1)-B1,DAY(A1)) ] 12. Add Year to or Subtract Year from a Given Date In many business problems, you might encounter situations where you will need to add or subtract years from a given date. Let's say A1 contains Date and B1 contains numbers of years. If you want to add Years to a given date, formulas would be - =EDATE(A1,12B1) =DATE(YEAR(A1)+B1,MONTH(A1),DAY(A1)) If you want to subtract Years from a given date, formulas would be - =EDATE(A1,-12B1) =DATE(YEAR(A1)-B1,MONTH(A1),DAY(A1)) 13. Convert a Number to a Month Name Use below formula to generate named 3 lettered month like Jan, Feb....Dec Mubarak G haith

=TEXT(A1*30,"mmm") Replace "mmm" with "mmmm" to generate full name of the month like January, February....December in any of the formulas in this post.

14. Convert a Month Name to Number Say Cell A1 contains the string January, February….December (or Jan. Feb…..Dec) and you want to show 1, 2…… =MONTH("1"&A1) The formula would work as long as month names are >=3 characters. Hence, it would work for say Janu or Decem or Apri or Octobe. 15. Convert a Number to Weekday Name Suppose you want to return 1 = Sunday, 2 = Monday…..7 = Saturday =TEXT(DATE(2017,1,A1),"dddd") Note – 2017 has been used in above formula as 1-Jan-2017 was Sunday. You can use any year where 1-Jan was Sunday like year 2023. To show only 3 characters of the Weekday Name, replace dddd with ddd =TEXT(DATE(2017,1,A1),"ddd") You can add a number to A1 if you want to show some other Weekday Name Say, if you want to show 1 = Monday, 2 = Tuesday…….7 = Sunday, just add 1 to A =TEXT(1+DATE(2017,1,A1),"dddd") Say, if you want to show 1 = Friday, 2 = Saturday…….7 = Thursday, just add 5 to A =TEXT(5+DATE(2017,1,A1),"dddd") 16. Convert a Weekday Name to Number Say Cell A1 contains the string Sunday, Monday….Saturday (or Sun, Mon…..Sat) and you want to show 1, 2…..7, then following formula can be used to return the numbers. Sunday will be 1 and Saturday will be 7. =ROUND(SEARCH(LEFT(A1,2),"SuMoTuWeThFrSa")/2,0) =MATCH(LEFT(A1,2),{"Su","Mo","Tu","We","Th","Fr","Sa"},0) If we want to return some other number to weekdays, then formula can be tweaked accordingly. For example, to make Mon = 1 and Sun = 7 Mubarak G haith

20. Determine Quarter for Fiscal Year Few countries follow different quarter other than Q1 from Jan-Mar and Q2 for Apr-Jun. In case of Jan-Mar as Q1, formula is simple (if cell A2 is date) =ROUNDUP(MONTH(A2)/3,0) This will give result as 1, 2, 3 & 4 for the quarters. If you want, you can concatenate "Q" in the formula to show Q1, Q2 etc as below ="Q"&ROUNDUP(MONTH(A2)/3,0) If your financial / fiscal year starts in Apr, then for Jan-Mar, quarter is 4 whereas for Apr to Jun, quarter is 1 and so on. In this case, you can use following formula =CEILING(MONTH(EDATE(A1,-3))/3,1) = ROUNDUP(MONTH(EDATE(A1,-3))/3,0) If your financial / fiscal year starts in Jul, then for Jan-Mar, quarter is 3 whereas for Jul to Sep, quarter is 1 and so on. In this case, you can use following formula =CEILING(MONTH(EDATE(A1,-6))/3,1) = ROUNDUP(MONTH(EDATE(A1,- 6 ))/3,0) If your financial / fiscal year starts in Oct, then for Jan-Mar, quarter is 2 whereas for Oct to Dec, quarter is 1 and so on. In this case, you can use following formula =CEILING(MONTH(EDATE(A1,- 9 ))/3,1) = ROUNDUP(MONTH(EDATE(A1,- 9 ))/3,0) 21. Calculate Age from Given Birthday =DATEDIF(A1,TODAY(),"y")&" Years "&DATEDIF(A1,TODAY(),"ym")&" Months "&DATEDIF(A1,TODAY(),"md")&" Days" 22. Convert from dd/mm/yy to mm/dd/yy (DMY to MDY) Say you have following dates in DMY format 24/8/ 24/8/ 4/08/ 04/08/ And you need to convert them into MDY format, then use the following formula Case1 – if your default date format is MDY Mubarak G haith

=FILTERXML(""&SUBSTITUTE(TEXT(A1,"mm/dd/yyyy"),"/","")&"</t

","//s[2]")&"/"&FILTERXML(""&SUBSTITUTE(TEXT(A1,"mm/dd/yyyy"),"/","</s ")&"","//s[1]")&"/"&FILTERXML(""&SUBSTITUTE(TEXT(A1,"mm/d d/yyyy"),"/","")&"","//s[3]") Case2 – if your default date format is DMY =FILTERXML(""&SUBSTITUTE(TEXT(A1,"dd/mm/yyyy"),"/","")&"</t ","//s[2]")&"/"&FILTERXML(""&SUBSTITUTE(TEXT(A1,"dd/mm/yyyy"),"/","</s ")&"","//s[1]")&"/"&FILTERXML(""&SUBSTITUTE(TEXT(A1,"dd/m m/yyyy"),"/","")&"","//s[3]")

23. Convert from mm/dd/yy to dd/mm/yy (MDY to DMY) Say you have following dates in MDY format 8/24/ 22 8/24/ 8 /0 4 / 08 /0 4 / And you need to convert them into DMY format, then use following formula Case1 – if your default date format is MDY =(FILTERXML(""&SUBSTITUTE(TEXT(A1,"mm/dd/yyyy"),"/","")&"</ t>","//s[2]")&"/"&FILTERXML(""&SUBSTITUTE(TEXT(A1,"mm/dd/yyyy"),"/","")&"","//s[1]")&"/"&FILTERXML(""&SUBSTITUTE(TEXT(A1,"mm/d d/yyyy"),"/","")&"","//s[3]")) Case2 – if your default date format is DMY =FILTERXML(""&SUBSTITUTE(TEXT(A1,"dd/mm/yyyy"),"/","")&"","//s[2]")&"/"&FILTERXML(""&SUBSTITUTE(TEXT(A1,"dd/mm/yyyy"),"/","")&"","//s[1]")&"/"&FILTERXML(""&SUBSTITUTE(TEXT(A1,"dd/m m/yyyy"),"/","")&"","//s[3]") Note – Basically MDY to DMY and DMY to MDY are same formulas as we are just **swapping the place of MM with DD and doing nothing else.

  1. Number to Date Format Conversion** If you have numbers like 010216 and you want to convert this to date format, then the following formula can be used =--TEXT(A1,"00/00/00") for 2 digits year Note – Minimum 5 digits are needed for above formula to work Mubarak G haith

If it has decimal minutes say 1415, then you can use following formula to convert it back into time =A1/ If it has decimal seconds say 84900, then you can use following formula to convert it back into time =A1/ (Note – You will need to format your result cell in Time format)

28. Generate a Sequence of Dates Generate 90 sequential dates starting 1-Apr- 21. Let's say that the date is in cell A1. You can use either of following formulas =SEQUENCE(90,,A1) =ROW(INDIRECT(A1&":"&A1+89)) Now, let's generate all dates of a given month. Let's say this is Feb-2021. You can use following formula where A1 has the date 1-Feb- 2021 =SEQUENCE(DAY(EOMONTH(A1,0)),,A1) =ROW(INDIRECT(A1&":"&EOMONTH(A1,0))) Above formulas will generate dates in a column. To generate in a row =SEQUENCE(,90,A1) =TRANSPOSE(ROW(INDIRECT(A1&":"&A1+89))) =SEQUENCE(,DAY(EOMONTH(A1,0)),A1) =TRANSPOSE(ROW(INDIRECT(A1&":"&EOMONTH(A1,0)))) 29. Generate a Sequence of Times Generate 40 sequential times starting at 11 AM with an increment of 15 minutes where A1:=11:00 AM =A 1 +SEQUENCE(40,,,15/(2460)) =A 1 +(ROW(1:40)-1)15/(24*60) 30. How to Know if a Year is a Leap Year Mubarak G haith

Let's say that A1 contains the year. To know whether it is a Leap Year or not, use following formula - =MONTH(DATE(A1,2,29))= =DAY(EOMONTH(DATE(A1,2,1),0))= TRUE means that it is Leap Year and FALSE means that this is not a Leap Year.

31. Last Working Day of the Month If a Date is Given If A1 holds a date, the formula for calculating last Working Day of the month would be =WORKDAY(EOMONTH(A1,0)+1,-1) The above formula assumes that your weekends are Saturday and Sunday. But, if your weekends are different (e.g. in gulf countries), you can use following formula - =WORKDAY.INTL(EOMONTH(A1,0)+1,-1,"0000110") Where 0000110 is a 7 character string, 1 represents a weekend and 0 is a working day. First digit is Monday and last digit is Sunday. The above example is for Gulf countries where Friday and Saturday are weekends. You also have an option to give a range which has holidays. In that case, your formula would become =WORKDAY(EOMONTH(A1,0)+1,-1,D1:D10) =WORKDAY.INTL(EOMONTH(A1,0)+1,-1,"0000110",D1:D10) Where range D1:D10 contains the list of holidays. 32. First Working Day of the Month if a Date is Given If A1 contains a date, then formula for First Working Day of the month would be =WORKDAY(EOMONTH(A1,-1),1) The above formula assumes that your weekends are Saturday and Sunday. But, if your weekends are different (e.g. in gulf countries), you can use following formula - =WORKDAY.INTL(EOMONTH(A1,-1),1,"0000110") Where 0000110 is a 7 character string, 1 represents a weekend and 0 is a working day. First digit is Monday and last digit is Sunday. The above example is for Gulf countries where Friday and Saturday are weekends. Mubarak G haith

If you have got your list of holidays in a range say B1:B20 (B1:B20 should contain dates in date format), you can have following formulas =NETWORKDAYS(DATE(A1,A2,1), EOMONTH(DATE(A1,A2,1),0),B1:B20) =NETWORKDAYS.INTL(DATE(A1,A2,1), EOMONTH(DATE(A1,A2,1),0),"0000110",B1:B20)

35. How Many Mondays or any other Day of the Week between 2 Dates Suppose A1 = 23-Jan-16 and A2 = 10-Nov-16. To find number of Mondays between these two dates =SUM(--(WEEKDAY(ROW(INDIRECT(A1&":"&A2)))=2)) =SUMPRODUCT(--(TEXT(ROW(INDIRECT(A1&":"&A2)),"ddd")="Mon")) =SUMPRODUCT(--(WEEKDAY(ROW(INDIRECT(A1&":"&A2)))=2)) =SUMPRODUCT(--(TEXT(ROW(INDIRECT(A1&":"&A2)),"ddd")="Mon")) “Mon" can be replaced with any other day of the week as per need. 36. Find Number of Friday the 13th between Two Given Dates Assume you have been given two dates A1:=1-Jan- 2014 A2:=25-Nov- 2016 You can calculate number of Friday the 13th^ between these two dates by following formula =SUMPRODUCT((WEEKDAY(SEQUENCE(A2-A1+1,,A1))=6)(DAY(SEQUENCE(A2- A1+1,,A1))=13)) =SUMPRODUCT((WEEKDAY(ROW(INDIRECT(A1&":"&A2)))=6)(DAY(ROW(INDIRECT(A 1&":"&A2)))=13)) 37. Calculate Next Working day if date falls on a Weekend / Holiday Suppose you are given a date and you are asked to calculate next working day if date is of weekend. If date is a regular workday, then you should show the same date. For example – 8 - Mar-19 is a working day. Hence, you should show the same date. But if this is either 9- Mar-19 or 10-Mar-19 which are Saturday and Sunday, then you must show 11-Mar-19 as the next workday. In this case, formula to be used would be =WORKDAY(A2-1,1) Mubarak G haith

Assuming, your holidays are in E2:E3, then formula would be =WORKDAY(A2-1,1,$E$2:$E$3) Note – If you are using weekends other than Saturday and Sunday, use WORKDAY.INTL with appropriate parameters.

38. Calculate Previous Working day if date falls on a Weekend / Holiday Suppose you are given a date and you are asked to calculate Previous Working day if date is of weekend. If date is a regular workday, then you should show the same date. For example – 8 - Mar-19 is a working day. Hence, you should show the same date. But if this is either 9-Mar-19 or 10-Mar-19 which are Saturday and Sunday, then you must show 8- Mar-19 as the previous workday. In this case, formula to be used would be =WORKDAY(A2+1,-1) Assuming, your holidays are in E2:E3, then formula would be =WORKDAY(A2+1,-1,$E$2:$E$3) Mubarak G haith