Formula for displaying day, hours and minutes from a different cell locations if the cell does not calculate the first formula

Stef9910

Board Regular
Joined
Nov 2, 2022
Messages
72
Office Version
  1. 2010
Platform
  1. Windows
Hello all,

Not sure how to explain this, I have a formula for day, hours and minutes in cell, =INT(S15-L15)& " Days " &HOUR(S15-L15) & " Hrs " &MINUTE(S15-L15)& " Mins ", but if the formula cannot calculate from the select cells (S15-L15), I would like it calculate the days, hours and minutes from different cells, (T15-E15).

Any help would be muchly appreciated.

StatusReceivedTime between received and startedStartedTime taken to be completed or handed back if not completedCompletedHanded Back if not completed
Completed2/04/2023 20:420 Days 1 Hrs 3 Mins2/04/2023 21:451 Days 18 Hrs 14 Mins4/04/2023 15:59N/A
Completed20/04/2023 11:050 Days 0 Hrs 0 Mins20/04/2023 11:050 Days 6 Hrs 43 Mins20/04/2023 17:48N/A
Not Completed23/04/2023 23:37#VALUE!N/A#VALUE!N/A28/04/2023 15:15
 

Attachments

  • mrexcel question.png
    mrexcel question.png
    21.4 KB · Views: 19

Excel Facts

Add Bullets to Range
Select range. Press Ctrl+1. On Number tab, choose Custom. Type Alt+7 then space then @ sign (using 7 on numeric keypad)
will S or L always have a N/A in the cell , when you want to calculate using different cells or could it be blank ?

=IF( OR(S15="NA",L15="NA"),
INT(T15-E15)& " Days " &HOUR(T15-E15) & " Hrs " &MINUTE(T15-E15)& " Mins ",
INT(S15-L15)& " Days " &HOUR(S15-L15) & " Hrs " &MINUTE(S15-L15)& " Mins ")

usually if an Error you get the #

its possible T15 or E15 may not have a date time in

Note: Images are difficult to see , and also requires that I input all the data myself, which means I may make an error, which is very time consuming, and from my point of view less likely to get a response, if a complicated spreadsheet. Plus we cannot see any of the formulas used.

Therefore -

A SMALL sample spreadsheet, around 10-20 rows, would help a lot here, with all sensitive data removed, and expected results mocked up and manually entered, with a few notes of explanation.

MrExcel has a tool called “XL2BB” that lets you post samples of your data and will allow us to copy/paste your sample data into our Excel spreadsheets, saving a lot of time.

You can also test to see if it works ok, in the "Test Here" forum.

OR if you cannot get XL2BB to work, or have restrictions on your PC

then put the sample spreadsheet onto a share

I only tend to goto OneDrive, Dropbox or google docs , as I'm never certain of other random share sites and possible virus.
Please make sure you have a representative data sample and also that the data has been desensitised, remember this site is open to anyone with internet access to see - so any sensitive / personal data should be removed

Make sure you set any share or google to share to everyone
 
Upvote 0
Solution
Perfect, thank you, worked well.

I will in future share a mini sheet via OneDrive due to work computer limitations.
 
Upvote 0

Forum statistics

Threads
1,223,883
Messages
6,175,168
Members
452,615
Latest member
bogeys2birdies

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top