Date calculation

%3CLINGO-SUB%20id%3D%22lingo-sub-1531878%22%20slang%3D%22en-US%22%3EDate%20calculation%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1531878%22%20slang%3D%22en-US%22%3E%3CP%3EH%20everybody%20!%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20need%20help%20on%20my%20excel....%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20have%20an%20excel%20with%20two%20columns%2C%20on%20for%20the%20entry%20date%20and%20one%20for%20the%20exit%20day.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20use%20it%20to%20calculate%20the%20price%20when%20i%20kkeep%20dog.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EWhen%20in%20want%20to%20do%20a%20function%20to%20calculate%20the%20time%20between%20this%20two%20dates%2C%20there%20is%20always%20a%20mistake.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3Efor%20exemple%20i%20have%20a%20dog%203%20days%20from%20the%2021%2F07%2F2020%20to%20the%2023%2F07%2F2020%2C%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3D(21%2F07%2F2020%20-%2023%2F07%2F2020)*price%20%3D%20___%E2%82%AC%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3Ebut%20between%20this%20two%20dates%2C%26nbsp%3Bit%20takes%20me%202%20days%20instead%20of%203...%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3Edo%20you%20have%20a%20solution%20%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20use%20excel%202019%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3Ethanks%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-1531878%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EExcel%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1531895%22%20slang%3D%22en-US%22%3ERe%3A%20Date%20calculation%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1531895%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F733155%22%20target%3D%22_blank%22%3E%40Gweno50%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3EYou%20just%20need%20to%20add%201%20after%20subtracting%20the%20dates.%3C%2FP%3E%3CP%3Ee.g.%20if%20A2%20has%20the%20Start%20Date%20and%20B2%20has%20the%20End%20Date%2C%20you%20may%20try...%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSTRONG%3E%3D(B2-A2%2B1)*Price%3C%2FSTRONG%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1531902%22%20slang%3D%22en-US%22%3ERe%3A%20Date%20calculation%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1531902%22%20slang%3D%22en-US%22%3E%3CP%3EHello%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F733155%22%20target%3D%22_blank%22%3E%40Gweno50%3C%2FA%3E%26nbsp%3B%2C%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThe%20difference%20in%20date%20always%20gives%20the%20days%20between%20two%20dates%20in%20subject%2C%20hence%20you%20needs%20to%20add%201%20to%20the%20difference%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EPlease%20find%20below%20the%20possible%20solution%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22sunil_daware_0-1595176244065.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F206286iAED8D08A89EADF68%2Fimage-size%2Fmedium%3Fv%3D1.0%26amp%3Bpx%3D400%22%20title%3D%22sunil_daware_0-1595176244065.png%22%20alt%3D%22sunil_daware_0-1595176244065.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3ESample%20excel%20sheet%20is%20also%20attached.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EHope%20this%20will%20of%20help%20to%20you.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ECheers.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1531925%22%20slang%3D%22en-US%22%3ERe%3A%20Date%20calculation%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1531925%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F725566%22%20target%3D%22_blank%22%3E%40sunil_daware%3C%2FA%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3Ethanks%20for%20your%20answer.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3Eadd%201%20to%20the%20result%20that%20what%20i%20already%20do%20but%20i%20was%20excpeting%20a%20better%20solution%20!%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3Ethanks%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E
New Contributor

H everybody !

 

I need help on my excel....

 

I have an excel with two columns, on for the entry date and one for the exit day.

 

I use it to calculate the price when i kkeep dog.

 

When in want to do a function to calculate the time between this two dates, there is always a mistake.

 

for exemple i have a dog 3 days from the 21/07/2020 to the 23/07/2020,

 

=(21/07/2020 - 23/07/2020)*price = ___€

 

but between this two dates, it takes me 2 days instead of 3...

 

do you have a solution ?

 

I use excel 2019

 

thanks

3 Replies

@Gweno50 

You just need to add 1 after subtracting the dates.

e.g. if A2 has the Start Date and B2 has the End Date, you may try...

 

=(B2-A2+1)*Price

Hello @Gweno50 ,

 

The difference in date always gives the days between two dates in subject, hence you needs to add 1 to the difference

 

Please find below the possible solution

sunil_daware_0-1595176244065.png

Sample excel sheet is also attached.

 

Hope this will of help to you.

 

Cheers.

 

@sunil_daware

 

thanks for your answer.

 

add 1 to the result that what i already do but i was excpeting a better solution ! 

 

thanks