SOLVED

Total hours between two time ranges

%3CLINGO-SUB%20id%3D%22lingo-sub-2377852%22%20slang%3D%22en-US%22%3ETotal%20hours%20between%20two%20time%20ranges%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2377852%22%20slang%3D%22en-US%22%3E%3CP%3EHello%2C%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20would%20like%20to%20find%20the%20total%20hours%20between%207%3A30%20am%20to%2012%3A30%20pm%20on%20same%20day%20in%20excel.%3C%2FP%3E%3CTABLE%20width%3D%22428%22%3E%3CTBODY%3E%3CTR%3E%3CTD%20width%3D%22199%22%3ETIME%3C%2FTD%3E%3CTD%20width%3D%22229%22%3ETOTAL%20HOURS%3C%2FTD%3E%3C%2FTR%3E%3CTR%3E%3CTD%3E7%3A30%20to%2012%3A30%3C%2FTD%3E%3CTD%3E%3F%3C%2FTD%3E%3C%2FTR%3E%3C%2FTBODY%3E%3C%2FTABLE%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EPlease%20guide.%20Thank%20you%20so%20much.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-2377852%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EExcel%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2377880%22%20slang%3D%22en-US%22%3ERe%3A%20Total%20hours%20between%20two%20time%20ranges%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2377880%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F1060632%22%20target%3D%22_blank%22%3E%40Onlinehelp%3C%2FA%3E%26nbsp%3BCan%20you%20split%20the%20TIME%20column%20into%20two%3F%20One%20for%20start%20time%20and%20one%20for%20end%20time.%20Then%20you%20can%20simple%20use%20a%20formula%20like%20end-time%20minus%20start-time%20to%20calculate%20duration.%20For%20example%20%3CSTRONG%3E%3DB2-A2%3C%2FSTRONG%3E%3C%2FP%3E%3CP%3EDepending%20on%20the%20times%20involved%20you%20may%20have%20to%20perform%20some%20other%20steps.%20Better%20to%20upload%20a%20file%20with%20some%20examples%20that%20you%20encounter%20in%20real%20life.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2377881%22%20slang%3D%22en-US%22%3ERe%3A%20Total%20hours%20between%20two%20time%20ranges%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2377881%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F403176%22%20target%3D%22_blank%22%3E%40Riny_van_Eekelen%3C%2FA%3E%26nbsp%3BThank%20you%20%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F403176%22%20target%3D%22_blank%22%3E%40Riny_van_Eekelen%3C%2FA%3E%20for%20your%20reply.%20Below%20is%20the%20real%20life%20scenario%20where%20I%20would%20like%20to%20fill%20in%20the%20total%20hours.%20Ideally%20no%20the%20TIME%20column%20in%20only%20in%20one%20column%20but%20can%20be%20little%20creative%20if%20there%20is%20a%20guidance%20from%20you%2Fsomeone.%20Thanks.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CTABLE%20width%3D%22639%22%3E%3CTBODY%3E%3CTR%3E%3CTD%20width%3D%2283%22%3EName%3C%2FTD%3E%3CTD%20width%3D%2273%22%3ESat%3C%2FTD%3E%3CTD%20width%3D%2283%22%3ESun%3C%2FTD%3E%3CTD%20width%3D%2264%22%3EMon%3C%2FTD%3E%3CTD%20width%3D%2264%22%3ETue%3C%2FTD%3E%3CTD%20width%3D%2264%22%3EWed%3C%2FTD%3E%3CTD%20width%3D%2264%22%3EThu%3C%2FTD%3E%3CTD%20width%3D%2264%22%3EFri%3C%2FTD%3E%3CTD%20width%3D%2280%22%3ETotal%20Hrs%3C%2FTD%3E%3C%2FTR%3E%3CTR%3E%3CTD%3ETom%3C%2FTD%3E%3CTD%3E9%3A00-7%3A00%3C%2FTD%3E%3CTD%3E10%3A00-7%3A00%3C%2FTD%3E%3CTD%3E2%3A00-9%3A00%3C%2FTD%3E%3CTD%3E%26nbsp%3B%3C%2FTD%3E%3CTD%3E%26nbsp%3B%3C%2FTD%3E%3CTD%3E8%3A30-1%3A30%3C%2FTD%3E%3CTD%3E2%3A00-9%3A00%3C%2FTD%3E%3CTD%3E%3F%3C%2FTD%3E%3C%2FTR%3E%3CTR%3E%3CTD%3EMark%3C%2FTD%3E%3CTD%3E%26nbsp%3B%3C%2FTD%3E%3CTD%3E%26nbsp%3B%3C%2FTD%3E%3CTD%3E%26nbsp%3B%3C%2FTD%3E%3CTD%3E8%3A00-1%3A30%3C%2FTD%3E%3CTD%3E8%3A00-1%3A30%3C%2FTD%3E%3CTD%3E2%3A00-9%3A00%3C%2FTD%3E%3CTD%3E%26nbsp%3B%3C%2FTD%3E%3CTD%3E%3F%3C%2FTD%3E%3C%2FTR%3E%3CTR%3E%3CTD%3EHarry%3C%2FTD%3E%3CTD%3E%26nbsp%3B%3C%2FTD%3E%3CTD%3E%26nbsp%3B%3C%2FTD%3E%3CTD%3E%26nbsp%3B%3C%2FTD%3E%3CTD%3E2%3A00-9%3A00%3C%2FTD%3E%3CTD%3E2%3A00-9%3A00%3C%2FTD%3E%3CTD%3E%26nbsp%3B%3C%2FTD%3E%3CTD%3E8%3A30-1%3A30%3C%2FTD%3E%3CTD%3E%3F%3C%2FTD%3E%3C%2FTR%3E%3C%2FTBODY%3E%3C%2FTABLE%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2377883%22%20slang%3D%22en-US%22%3ERe%3A%20Total%20hours%20between%20two%20time%20ranges%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2377883%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F1060632%22%20target%3D%22_blank%22%3E%40Onlinehelp%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EAs%20variant%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22image.png%22%20style%3D%22width%3A%20634px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F282838i45D82C4839937B2D%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22image.png%22%20alt%3D%22image.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3Ewith%3C%2FP%3E%0A%3CPRE%20class%3D%22lia-code-sample%20language-excel%22%3E%3CCODE%3E%3DRIGHT(A2%2C%20LEN(A2)-(SEARCH(%22%20to%20%22%2CA2)%2B3))-LEFT(A2%2CSEARCH(%22%20to%20%22%2CA2))%3C%2FCODE%3E%3C%2FPRE%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2377885%22%20slang%3D%22en-US%22%3ERe%3A%20Total%20hours%20between%20two%20time%20ranges%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2377885%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F1060632%22%20target%3D%22_blank%22%3E%40Onlinehelp%3C%2FA%3E%26nbsp%3BThat's%20a%20bit%20different%20from%20your%20original%20question.%20It%20seems%20you%20have%20a%20bunch%20of%20texts%20in%20all%20the%20time%20columns.%20You%20could%20do%20a%20number%20of%20formulae%20similar%20to%20what%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F521%22%20target%3D%22_blank%22%3E%40Sergei%20Baklan%3C%2FA%3E%26nbsp%3Bjust%20suggested%20or%20do%20what%20I%20suggested%20earlier.%20Split%20the%20columns.%20Alternatively%2C%20perhaps%20Power%20Query%20could%20do%20what%20you%20need%20without%20the%20need%20of%20complex%20formulae.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2377888%22%20slang%3D%22en-US%22%3ERe%3A%20Total%20hours%20between%20two%20time%20ranges%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2377888%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F1060632%22%20target%3D%22_blank%22%3E%40Onlinehelp%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EAs%20variant%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22image.png%22%20style%3D%22width%3A%20562px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F282839i7ED21E117C06FADD%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22image.png%22%20alt%3D%22image.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3Ewith%3C%2FP%3E%0A%3CPRE%20class%3D%22lia-code-sample%20language-excel%22%3E%3CCODE%3E%3DSUM(%0A%20%20%20IFERROR(%0A%20%20%20%20%20MOD(RIGHT(C7%3AI7%2C%20LEN(C7%3AI7)-SEARCH(%22-%22%2CC7%3AI7))%20-%0A%20%20%20%20%20%20%20%20%20LEFT(C7%3AI7%2C%20SEARCH(%22-%22%2CC7%3AI7)-1)%2C%0A%20%20%20%20%200.5)%2C0))%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CP%3Ebut%20it%20very%20depends%20on%20do%20you%20have%20overnight%20shifts%20or%20not%20and%20do%20you%20keep%20exactly%20the%20same%20format%20for%20all%20time%20periods.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2377901%22%20slang%3D%22en-US%22%3ERe%3A%20Total%20hours%20between%20two%20time%20ranges%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2377901%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F1060632%22%20target%3D%22_blank%22%3E%40Onlinehelp%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EForgot%20to%20say%20above%20is%20for%20Excel%20which%20supports%20dynamic%20arrays%2C%20otherwise%20array%20formula%20with%20Ctrl%2BShift%2BEnter%20shall%20be%20used.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2377904%22%20slang%3D%22en-US%22%3ERe%3A%20Total%20hours%20between%20two%20time%20ranges%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2377904%22%20slang%3D%22en-US%22%3ENo%20overnight%20shifts.%20Same%20format%20for%20all%20time%20periods.%20Let%20me%20try%20to%20test%20at%20me%20end%20and%20will%20update.%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2377912%22%20slang%3D%22en-US%22%3ERe%3A%20Total%20hours%20between%20two%20time%20ranges%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2377912%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F521%22%20target%3D%22_blank%22%3E%40Sergei%20Baklan%3C%2FA%3E%26nbsp%3BGetting%20zero%20for%20me.%20It%20is%20excel%20home%20and%20student%202019%20edition.%20Thank%20you%20for%20the%20help.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Onlinehelp_0-1621695547426.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F282840i90459E8A1DFF4396%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22Onlinehelp_0-1621695547426.png%22%20alt%3D%22Onlinehelp_0-1621695547426.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2377939%22%20slang%3D%22en-US%22%3ERe%3A%20Total%20hours%20between%20two%20time%20ranges%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2377939%22%20slang%3D%22en-US%22%3E%3CP%3EIf%20there%20are%20no%20overnight%20values%2C%20how%20does%20one%20interpret%2010%3A00%20-%207%3A00%3F%26nbsp%3B%20As%20compared%20to%2C%20say%2C%202%3A00-9%3A00.%3C%2FP%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F1060632%22%20target%3D%22_blank%22%3E%40Onlinehelp%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2377954%22%20slang%3D%22en-US%22%3ERe%3A%20Total%20hours%20between%20two%20time%20ranges%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2377954%22%20slang%3D%22en-US%22%3EThen%20should%20it%20be%20say%20AM%20to%20PM%20written%3F%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2378041%22%20slang%3D%22en-US%22%3ERe%3A%20Total%20hours%20between%20two%20time%20ranges%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2378041%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F1060632%22%20target%3D%22_blank%22%3E%40Onlinehelp%3C%2FA%3E%26nbsp%3B%2C%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F891695%22%20target%3D%22_blank%22%3E%40tusharm10%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EIf%20the%20difference%20between%20end%20and%20start%20is%20negative%20it%20assumes%20that%20start%20is%20before%20midday%20and%20the%20end%20after.%20It%20is%20calculated%20as%20%3DMOD(end-start%2C%200.5).%26nbsp%3B%20But%20that%20gives%20incorrect%20result%20for%20long%20shifts%20(more%20than%2012%20hours)%20or%20in%20situations%20where%20under%2001%3A00-02%3A00%20you%20assume%201am-2pm%20(also%20long%20shift).%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EYes%2C%20more%20correct%20will%20be%20to%20use%20full%20time.%20From%20calculations%20point%20of%20view%20more%20suitable%20will%20be%2014%3A00%20format%2C%20not%202pm.%20Since%20the%20latest%20is%20hard%20in%20maintenance.%20We%20always%20shall%20use%20%222pm%22%2C%20not%20%222%20pm%22%20or%20%222p.m.%22%20or%20something%20else.%20Or%20we%20shall%20consider%20in%20formula%20all%20possible%20notations.%20That's%20possible%2C%20but%20formula%20will%20be%20much%20more%20complex.%20And%20formula%20itself%20depends%20on%20which%20Excel%20do%20you%20use%2C%20365%20or%202019%20or%20something%20else.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2378228%22%20slang%3D%22en-US%22%3ERe%3A%20Total%20hours%20between%20two%20time%20ranges%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2378228%22%20slang%3D%22en-US%22%3E%3CP%3EOK%2C%20so%20assuming%20you%20want%20to%20smallest%20amount%20of%20positive%20time%20difference%2C%20and%20with%20the%20from-to%20value%20in%20D2%2C%20use%3C%2FP%3E%3CPRE%20class%3D%22lia-code-sample%20language-excel%22%3E%3CCODE%3E%3DLET(_dash%2CSEARCH(%22-%22%2CD2)%2C%0A%20%20%20%20_start%2C--TRIM(LEFT(D2%2C_dash-1))%2C%0A%20%20%20%20_end%2C--TRIM(MID(D2%2C_dash%2B1%2C255))%2C%0A%20%20%20%20_end-_start%2B12*(_end%26lt%3B_start))%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F1060632%22%20target%3D%22_blank%22%3E%40Onlinehelp%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E
Occasional Contributor

Hello,

 

I would like to find the total hours between 7:30 am to 12:30 pm on same day in excel.

TIMETOTAL HOURS
7:30 to 12:30?

 

Please guide. Thank you so much.

13 Replies

@Onlinehelp Can you split the TIME column into two? One for start time and one for end time. Then you can simple use a formula like end-time minus start-time to calculate duration. For example =B2-A2

Depending on the times involved you may have to perform some other steps. Better to upload a file with some examples that you encounter in real life.

@Riny_van_Eekelen Thank you @Riny_van_Eekelen for your reply. Below is the real life scenario where I would like to fill in the total hours. Ideally no the TIME column in only in one column but can be little creative if there is a guidance from you/someone. Thanks.

 

NameSatSunMonTueWedThuFriTotal Hrs
Tom9:00-7:0010:00-7:002:00-9:00  8:30-1:302:00-9:00?
Mark   8:00-1:308:00-1:302:00-9:00 ?
Harry   2:00-9:002:00-9:00 8:30-1:30?

@Onlinehelp 

As variant

image.png

with

=RIGHT(A2, LEN(A2)-(SEARCH(" to ",A2)+3))-LEFT(A2,SEARCH(" to ",A2))

@Onlinehelp That's a bit different from your original question. It seems you have a bunch of texts in all the time columns. You could do a number of formulae similar to what @Sergei Baklan just suggested or do what I suggested earlier. Split the columns. Alternatively, perhaps Power Query could do what you need without the need of complex formulae.

best response confirmed by Onlinehelp (Occasional Contributor)
Solution

@Onlinehelp 

As variant

image.png

with

=SUM(
   IFERROR(
     MOD(RIGHT(C7:I7, LEN(C7:I7)-SEARCH("-",C7:I7)) -
         LEFT(C7:I7, SEARCH("-",C7:I7)-1),
     0.5),0))

but it very depends on do you have overnight shifts or not and do you keep exactly the same format for all time periods.

@Onlinehelp 

Forgot to say above is for Excel which supports dynamic arrays, otherwise array formula with Ctrl+Shift+Enter shall be used.

No overnight shifts. Same format for all time periods. Let me try to test at me end and will update.

@Sergei Baklan Getting zero for me. It is excel home and student 2019 edition. Thank you for the help.

 

Onlinehelp_0-1621695547426.png

 

If there are no overnight values, how does one interpret 10:00 - 7:00?  As compared to, say, 2:00-9:00.

@Onlinehelp 

Then should it be say AM to PM written?

@Onlinehelp , @tusharm10 

If the difference between end and start is negative it assumes that start is before midday and the end after. It is calculated as =MOD(end-start, 0.5).  But that gives incorrect result for long shifts (more than 12 hours) or in situations where under 01:00-02:00 you assume 1am-2pm (also long shift).

 

Yes, more correct will be to use full time. From calculations point of view more suitable will be 14:00 format, not 2pm. Since the latest is hard in maintenance. We always shall use "2pm", not "2 pm" or "2p.m." or something else. Or we shall consider in formula all possible notations. That's possible, but formula will be much more complex. And formula itself depends on which Excel do you use, 365 or 2019 or something else.

OK, so assuming you want to smallest amount of positive time difference, and with the from-to value in D2, use

=LET(_dash,SEARCH("-",D2),
    _start,--TRIM(LEFT(D2,_dash-1)),
    _end,--TRIM(MID(D2,_dash+1,255)),
    _end-_start+12*(_end<_start))

@Onlinehelp 

@Onlinehelp 

2019 doesn't support dynamic arrays. I have no machine with it to test right now, please try to enter formula as array one. Instead of Enter use Ctrl+Shift+Enter. {} shall appear around the formula.