If help

Peter1973

Well-known Member
Joined
May 13, 2006
Messages
957
I am trying to work out how to do this :

In cell A1 i have a time 21:00
In cell B1 I have a length of time ie 00:20 ( 20 minutes not 21 mins past midnight )
In Cell C1 I have a number ie 50.

I need a formula to look in cell A1 sunbtract B1 so in the above case would = 21:00 - 00:20 so would give 20:40. The if that time is between 19:00 and 21:00 return the value in C1 otherwise return a zero value.

Any help appreciated.
 
With those numbers, I get 54.

Excel Workbook
ABCDEFGH
1
2
3
421:0054
NP Breakdown
Excel Workbook
ABCDEFG
1
2
3
4
51:18
NP Per Hour
Excel Workbook
A
154
Sheet3
 
Upvote 0

Excel Facts

Waterfall charts in Excel?
Office 365 customers have access to Waterfall charts since late 2016. They were added to Excel 2019.
Think I will have to give up on this has have tried everything but I am still getting the value 0 returned.
 
Upvote 0
No, they are derived from another formula but I have checked the path and all are formatted in time ie hh:mm
 
Upvote 0
Thanks for your patience Hot Pepper I know it wasn't easy, I got the feeling something in my sheet was wrong so started again with a blank workbook and once all data in it now works great.

Only one question with the above formula is there a way to have the formula calculate multiple cells ie :
=AND('NP Breakdown'!F4-'NP Per Hour'!G5>"18:59"+0,'NP Breakdown'!F4-'NP Per Hour'!G5<"21:01"+0)*'NP Breakdown'!H4 and have it add the same formula but relplace F4 for K4 and H4 for M4 this will be repeated several times always moving 5 cells to the right, up to cc4 and ce4.
The only way I can think off is to keep repeating the formula and change the cell destinations but this would be very long.
 
Upvote 0

Forum statistics

Threads
1,215,635
Messages
6,125,945
Members
449,275
Latest member
jacob_mcbride

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