How to count time if value is present?

rageagainstjg

New Member
Joined
Aug 17, 2011
Messages
14
Office Version
  1. 365
Platform
  1. Windows
Hello all,

I am attempting to calculate how long consecutive occurrence instances happened. So with that being said please look at this link and know that column “D” is the one I need the formula for
Any help would be SO WONDERFUL as figuring it out manually stinks!
 

Excel Facts

Format cells as time
Select range and press Ctrl+Shift+2 to format cells as time. (Shift 2 is the @ sign).
I can't figure out how to edit my original post and I needed to update the question. So here is my original question but only expanded.

Hello all,

I am attempting to calculate how long consecutive occurrence instances happened, and the time period of occurrence. So with that being said please look at this link and know that column “D” and "E" are the ones I need the formula for

Any help would be SO WONDERFUL as figuring it out manually stinks!
 
Upvote 0
I can't figure out how to edit my original post
Once you have made some more posts you will be able to edit your posts for 10 minutes after posting. :)

Any help would be SO WONDERFUL
Help would likely come faster if ..

a) We knew what Excel version you are using since different versions have different functions available. Therefore I suggest that you update your Account details (or click your user name at the top right of the forum) so helpers always know what Excel version(s) & platform(s) you are using as the best solution often varies by version. (Don’t forget to scroll down & ‘Save’)

b) Helpers could copy your sample data to test rather than having to manually type it all out from a picture. MrExcel has a tool called “XL2BB” that lets you post samples of your data that will allow us to copy/paste it to our Excel spreadsheets, so we can work with the same copy of data that you are. Instructions on using this tool can be found here: XL2BB Add-in

Note that there is also a "Test Here” forum on this board. This is a place where you can test using this tool (or any other posting techniques that you want to test) before trying to use those tools in your actual posts.
 
Upvote 0
.. different versions have different functions available.
For example, if you have the XLOOKUP function ..

22 10 25.xlsm
ABCDE
1timeynwCountTot timePeriod
212:01y1  
312:02y20:0112:01 - 12:02
412:03n1  
512:04n2  
612:05n30:0212:01 - 12:05
712:06y1  
812:07y20:0112:01 - 12:07
912:08w1  
1012:09w2  
1112:10w3  
1212:11w4  
1312:12w5  
1412:13w60:0512:01 - 12:13
1512:14y1  
1612:15y20:0112:01 - 12:15
1712:16n1  
1812:17y1  
1912:18y20:0112:01 - 12:18
Consecutive
Cell Formulas
RangeFormula
C2:C19C2=IF(B2=B1,C1+1,1)
D2:D19D2=IF(C3>=C2,"",A2-XLOOKUP(1,C$2:C2,A$2:A2,,,-1))
E2:E19E2=IF(D2="","",TEXT(XLOOKUP(1,C$2:C2,A$2:A2),"hh:mm")&TEXT(A2," - hh:mm"))
 
Upvote 0

Forum statistics

Threads
1,215,465
Messages
6,124,977
Members
449,200
Latest member
Jamil ahmed

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