0% found this document useful (0 votes)
109 views

Excel Time and Date Cheat Sheets

Uploaded by

ashaya jha
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
0% found this document useful (0 votes)
109 views

Excel Time and Date Cheat Sheets

Uploaded by

ashaya jha
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
You are on page 1/ 4
EXCEL TIME & DATE seer Note: Dates in these examples are formatted dai/mm/yyyy DATE-TIME 101 Excel stores dates andtime as anumber ENTERING TIME Enter time as hamm:ss or hamm:ssAM/PM: knowns datetime seria number Entered Excel Returns Serial Number formatted ste Btime Yox/2012 00046 900 900 "0375 Underingsenalnumber — s0s0aieeeees? 190 100 0041666667 — 300 1300) 0541666667 (Se) (ee) Festa errr 100PM 0PM 5660667 catreentnere TMeY T1900. andcount T14530AM _TEIS30AM 0469097222 16:45 0697916567 0697916667 CRM § 4:45PM vsrateG67 697016667 © My Onine Ting Hab 2023 ‘Subtracting timefrom times: 4 ie a E EE] Tame homens Formats Rent 40) SS0AM_— SORE =8AD-CADAN0DAM 41, tooo oso sacs 123000 mm ‘2 Tgeo0pM 30000 8 2eneoam 4000 Notice thelastrasuk shows seus this iz because itresultsin anegatvetimesnd Excal cant display negative times, 252.2 80000 Pl SERCO sasesenees ‘Subtracting times from oneanother: 1 ENTERING DATE-TIME 4 c D © 4) SO0m0AM ToOODPM =Cee BS 40000 AM 43, t9000PM_Tio;oDPM -ce7.869 100000 AM 2ASOO PM ==1.Call £28 actually conainsatime-saialnumber of 1.08335, bu sincethe callis formatted to displaytios formattadashomm: onlythe time portionisvisile youwantte show the cumulative time like «ell £29) then you needto surround then part ofthe time formatin square brackets ikesa: nlsmnmss (BB rouowme (Gad) + (Shi) + @+en-+a FORMATTING Even though dates andtime areasareguar number knownasthe date-timeserial number, wecan male ussof etensvetermaning options todispiey themjustthewaywe want We can access some quickformatsfrom the Home tab>in the Number group Nevpectlomat sSmyOnlineTraininghub EXCEL TIME & DATE steer © My Onine Tang Hab 2023 CUSTOM DATE FORMATS Excel recognisesthefollowing charactersfor date formatting The ‘Formatted column. displays the resutts when appledto the dat : September3, 2016: Dipl dy at amber wot eng 20. Dipl te dy at armamberwth Dipl te dy as an abbreviation Sin nse. apis ey as aa ame tay esmseon apt te month asa ber wiht sessing 0, Dipl te one asa ruber wh lenny se men spoon mom DAFANE month ara stron Omredeo. Depts momma te mre Uanaeyto Decent beams nmnnn OBIPBE REM Seles Dipl tm yearasa two-digit notes P| wy Diplysteyewrasatou-dgtnante: 20 We can bringthe charactersto getherto create our owncustom formats: wer Samy sites? reeanon ‘ern aa dean eas m3 CUSTOM TIME FORMATS Like dates, time als ohasits ownset of ‘custom formatting chara ders: ‘movin towhomaccae swt aga ema saat WOO a2 | Dag ec Abe Hw Be Note: Them ormm code must appear immediately afterthe h or hhcode or immediately before the ss code; otherwise, Excel displays themonth instead of minutes. da Treacy | Microsoft MVP Ipingyoustand out from the crowd ‘And when usedtogetherwe eancresteform=s these: DATES ENTERED AS TEXT Dates incorrectly entered astextcannotbe used in formulasor PivotTablesand dort sort as expec. ‘Testingif Dates are Text-Option 1: Aquickway totes if yourdatesaretetisto change theformatto ‘General. Properdate- time serial numbers will badisplayed 225uch, whareactextdateswill il appearasdate, yov2017 2rore017 sy 4701/2017 5701/2017 42736 a7 42738 22739 amo $-%> 33 “Testingif Datezare Text-Option 2: Use the keyboardshortrt below to. temporarily display the dates without formatting. Datesin acomectdatetimeserial umber wil display as such =:S FIXING TEXT DATES ‘There are stew waystocomven taxtdatesto ste serisinumbers Depencingonthedste, some techniqueswork betterthan others an VAT eae 2 gt ow Option 2: Paste Special Linan empty cellent andcopythe ccellte theck pboars 2 Selectthe callecontaining thetee Gates youwant comet te dateserial umber 3. Hometab >Pase> 4, PasteSpecial dialogbox select: Values “Mttiply (or Divide) Option 3: DATEVALUE Function ‘The DATEVALUEfunction taker date text stringand conversit 2 date serial Number. Eg. -DATEVALUET'I/1/2027) Option 4: Power Query Date Tab> GetData> FromTable/Range. Click (onthe datatype conin the columnhieader > choose Date/Time, DateorTimeasrequied: 7 Decimal Number $ Curency 12) Whole Number 1 Percentage % Time CONVERTING DATE SERIAL NUMBERS TO TEXT ‘When referencing cells containing dtesfrom text boxes yourirsinead toconven themto ‘entto ensure they display comrecty. Wecan [Use the TEXT function for this 18 SoUsor oF obey emetA"ae: eae? 22) SOV2D1T Declan 7 = Dye ATENTERN nm dH) CONVERT MONTH NAME TO NUMBER Converts li of morthniameste morsh numbers withthe MONTH function: suenmean8) “crs $2 suenTuaseat Cac) 2 a Ss Cacerstan 7 SS imyoniinetraininghub EXCEL TIME & DATE steer EXTRACT DATES Have list of date-times andonly want the dates. UsetheINT functionto extractthe date component: 4 ® © ¢ 10) VMI FaMODAM—YOVZO7 =INTBIO) 11, ovzro17 20030-m exo? =e) 12) oxeya017 ano aM /anK207 NTR | oyorzo17 wana govan7 —=nt@13) M4) esnoer7 sano am sna =TBT6) EXTRACT TIMES Havea list of date-times andonly wantthe times, Use the MODfunctionto extract the date component: 7 18) OOVaO EanODAM HEED AM. =MODBTAN) 19) o1mapor7200s0PM 20030 PM =MOD8T91) 20) 0y03z017 113000 AM 113000 AML 21, O4ouz017 woemoAM 120090 AML = MODE’) 22) esnoyarrscoce ast $0000 aM =60OK8221) DATE CALCULATIONS Where columnB contains the Start Dateand column C contains the EndDate Calculate Age or Years of Service Wholevears: =YEARITODAY0)-YEARIE2) Fractions of Years: =YEARFRAC(E2TODAVO, 1) Difference Between Dates In days: =C2-B2 Inweeks (O27 \Wholemonthsroundedup: = (VEAR(C2}-YEAR(B2))*12=MONTH(C2}- MONTH(e2) Wholemonthsroundeddowr IF (DAY (C2) =DAY{E2),0,-1)~ (YEARIC2)- YEAR(B2)}*12* MONTH(C2)-MONTH(E2} Fractions of years = YEARFRAC(E2,C2,1) Wholeyears roundedup: =ROUNDUPYYEARFRACIE2, @, 1,0), Wholeyears rounded down: = YEAR(C2)-YEAR(B2) FINDING DATES Where columnB contains the date Number of days ina month: -DAY[EOMONTH(E2,0)} First day of monte EOMONTH(E2,-1}+1 Last day of month: =EOMONTHES,G Last day of previous month: =EOMONTH(EA®,-1) Treacy | Microsoft MvP yyoustand out from the crowd CONVERT TIME ‘To decimals where timeis enteredin Convertto hours multiply by 24 Convert to minutes multiply by 1440 Convertto seconds multiply by 86400 Convert housto days divide by 24 Convert minutesto hous — divide by 60 Convert secondsto minutes - divide by 60 FUNCTIONS | tMeruncnons DATE{year, month, day) Combines separsteyesr, month and day vats ‘and convansthaminto date serialnumber formattedasadate eg. .ATE2O23,01,01) -44927 January 1,2023) =004201) (OjTip: ifthe numberof daysadced excendsthe current year, itwill aid theencesstothestat ofthe following year. ‘TIME{hourmine second) Combines separatzhour, minute andsecond \aluas andeenversthaminte 3 time #2721 number. if thecellformat was General before the formulaisentered, the resukisformented sradateeg, DATEVALUE(date text) Convertsdate: sored ar tec toa datesertal umber. 2g. TIMEVALUEftime text Convertstimes stored astex to adatetine sefisinurber eg. IMEVALUE{"8:50 pm") ~.s680s5556 Nowo ‘The NOW function ie urwaval in thatitdoaent have any arguments Itsimply feu the current dateand timefromyour computer clock. TODAY ‘The TODAY function aloo dossnthaveany arguments Itsimplyretumsthecurentdate serilnumberfrom your computer clock. HOUR(serial_ number) Returns the hour integer froma timeseria number rarging rom Ot 23. eg referencing call B2 cortairing 5:30 PM =HOUR(E2) 7 ‘MuNUTe{serial number) Returns the minuteintager, ranging from Oto 59, froma timeseralnumber. e= referencing call B2 containing 5:30 PM =MINUTE(S2) =10 (Bi rowowme © My Onine Tang Hab 2023 ‘SECOND (serial nurmber) Returns the second iregerfrom atimeserial number rangingfrom0w 59. eg referencing, cell 82 coresinig 5:10.15 PM =SECONDIE2) 5 DAY{seriaL number) Returns the day ofthe month between 1 and 31 froma date seriinumber ortet 2g. =Day{"2023,315") 35 MONT (serial number} Returns the mont of date serialnumber betweend and 12, representing January ‘through December_e. =MONTH| DATEI2023,3,15)) 3 \EAR{serial_eurber} Returns the yenrfroma dateserial numberas ‘Bn integer between 1500 2nd9555 28. YEAR| DATE|2073,03,15)) 2023 \WEEKNUM|(earial number, [renure type!) Returns the week number (between 1 and5a) fz date serisinumber eg is Jan2003isin weeknumber 1 ofthe year ‘There are worpes ofsystemsavaiablewith this function ~ System Lwheretheweak containing January 1 isthe frst week of theyear, and isnumbered weeks, = Sytem 2 stanswaththe frst Thuaday ofthe year being in weak. This sysemisthe frethodology specfiedin 02601, whichis commonly known astheEuropeanweek umberingsyscem, Return type= (OiTips Return types? ard 1forMondayarethe same asone another Type 2isonlyinduded forbackwardcompatbiicy with eater varsions of Fxcel. Likewise, return te for Sunday. {soWeEKNUA(¢ate) Returns the week number ofa date serial umber. The frstMonday ofthe year marks thestanofweek 1 eg for Monday, Jan 2, 12027, ISOWWEEKNUM returns. “Tipit also works with datesinputasTexs, but this could be unreliable so its always Dex to workwith dateserialnumbers dmyonlineTraininghub EXCEL TIME & DATE steer \WEEXDAV(serial_number, [return type) Returns the day numberof the weak from ate serialnumber. Thedefauk reurn ope ranges from! for Sunday, through to 7for Saturday, butyou canchoose froma list of return types. B2- numbers Monday ough 7 Sunday 33 -tumbers0 Monday through 6 esunday) | G11 amber 1 ptoncay through 7 Sunday) | r2-tumbers 1 essen though 7 Mond} G15 numbers 3 Weamesda} trough 7 Tuessay) Gi 1e-mumbers 1 (Mursaay tough 7 Weamesdan (C315 umber 1 Friday) trough 7 Truséay, | 3 16-muambers 1 Saturday through 7 ridyh | {6317 numbers 1 Sunday through 7 Gaturday ‘QTip: Return types and 17 for Sunday arethe same asone another. Type lisonlyindudedter Dackwardcompatabilty with enrferversonsof Excel. Likewise, returntype2 and 3for Monday. eDATEstart_date, months) Rolls dateserial number ignoring any time ‘element forwardor back based on thenumber (of months specified inthe"months argument. ee =EDATE{DATE(2017,3,25) 1) 42840 (Apr'35, 2037) =EDATE(DATE[2017,3, 15}, -1) Ta27ei(fetruny 15,2017) FOMONTH(start_date, months) Returns the las-day ofthemonth beforeor shera star date sperfied witha dateserial umber (ignoring anytime demand). 2g. -FOMONTH(DATEI2017,3,15),1) 42855 (Apri 30, 2017) =EOMONTH(DATE{2017,3,35)-1) 42724 [February 28, 2017) WORKDAY star, gate days [hot days) Returns adateseral number that isthe specified numberof working days betoreor shter the sart date Workingdaysexchide weekendsand any daesidertfiedasholidoys, start_date-a date serial number orto days -number ofnon-weekend andnor- holidaysto addor subtract [holidays] -Optional ist of holidaysto exchide AWORKDAY(DATE(2016,12,25), 5) 42741 (Friday, lan6, 2037) Notes: only the date partionofa datetime serialnumber isusedlby WORKDAY. Any ime lementisignored Only whole numbersare recognisedby the ‘days’ argument eg. 17 would berounded sownte 1 \da Treacy | Microsoft MVP Ipingyoustand out from the crowd WORKDAY.INTL(start date, days, [weekends tholidays]) ike WORKDAY, exceptthe‘weskand’ ‘argument akoenstles you tachoose what days weekendstallon, from this: | B2-sunday, Monday | 3- Monday, Tuesaay | Gis tuesday, wednesday | -wWeanerday, Tursday | i6-Mmursaay, Friday | B7- Friday, Saturday | 11 -sundsy ony |B 12-Monday only | 13 - Tuesday only |G 14- Wednesday only | a 15-Tmurscay only Bis. Fray onty B17 Saturday ony y DAYS(end date start. date) Returns the numberef wholedaysbenveen two date serslnumbers Ignores time portions ofdatetimeseral numbers, DAYS360(start_date, end date, method) Returns the numberof daysberween two date serialnurbersbared ona 360day yex, or twelve 30-day morths.Thismethod isused in some accounting cakulatiors. ‘The optional ‘methaf arguments logical value (TRUE/FALSE)that spactieswhatherto Use the US [FALSE}or European method (TRUE) ifomittedit is wrested asFaL NETWORKDAYS(start date,end date, {holidays} Returns the numberof wholeworking days betweentwo date seriinumbers, exchiding weekends Saturday & Sunday) and halitays, NETWORKDAYS.INTL(start date, end_date, weekend], [hotdays) Like the NETWORKDAYS function it resume the numberof working daysbetween two date serisinumbers exchiding weskerdsnd holidays Westend dayscan bespectied, 59 2- Sunday, Monday GBS -sonsoy, twesdoy 3 4-Tuesaay, Weanesaay [EBs -weenesday, mursdoy a6 torr, Friday GB 7-Fray,Ssturoy Bi1-Sundey ony 3 12-menday only Gis -tuesa0y ony Gi 14-wesnersay onty Bs -moreaay ony i te-Frdayonty Bir -seturdy only ¥ (3 rowowme ay On ‘YEARFRAC(start date, end|_ date, basis) Returns the year fractionrepreserting the number of wholedaysbetween star. dateand fend_date serialnumbers [basis] is an optionalargumert thatallonsyou to specify the day coure method fromthelx of options Below. Homies, default 100. Ea2- aque 1B 3-Acunres Es eurepean 30360, DATEDIF(start date, end_date, unit) (CAUTION: This function isonlyirchided in Exel forbackwardcompatiaicy with Lows 1-23! If ‘youtry to enter the functionit won't display in ‘the auto-complete list, you mustbe brave and [press on, corfidentin the fac that whenyou ress ENTER itwilevaliate Note: DATEDIF calculstonsdonot include the ‘art dzteintheresutere count and they only return whole numbers. “Tip: when entering theUnie dractin the formula, surrounditwithdoublequatese.g. DATEDIF(start date, endl date, "MP Functions with this grey bactgroundare off ‘and availcbiefor bactwardcompastity only. SJmyontineTraininghub

You might also like