Count of span of cell activity

dovl

New Member
Joined
Apr 6, 2021
Messages
16
Office Version
  1. 2019
Platform
  1. Windows
Hi, I am looking for a formula to count the number of cells from the first cell with a number in it, through the last cell with a number in it, including blanks. My spreadsheet will have dates across the top row. These numbers represent how many times the device was used in a given days, and I'm trying to determine how many days the device was active including the dormant days. In My example highlighted in the spreadsheet pasted below, Im looking for a formula in cell V7 that will search the range (B7:R7), identify the first date of use i.e 1.23.21 (you can reference the date in row 1) and count the span of days/cells through its last day of activity i.e. 2.1.21 and produce the number of days "10". Technically I don't need to reference days, I'm just looking for the number of cells, but being that there are blank cells, It may make it hard to create a formula around that.

Thanks!

1620416530926.png
 

Excel Facts

Back into an answer in Excel
Use Data, What-If Analysis, Goal Seek to find the correct input cell value to reach a desired result
How about
Excel Formula:
=IF(COUNTIFS(B2:R2,"<>")=0,0,MAXIFS($B$1:$R$1,B2:R2,"<>")-MINIFS($B$1:$R$1,B2:R2,"<>")+1)
 
Upvote 0
Hmm that resulted in all the cells in column V returning 1 except row 3 yielded Zero. I tried downloading the XL2bb but having trouble with that. Thank you.
 
Upvote 0
Try this in V2:

Excel Formula:
=I
[QUOTE="Eric W, post: 5687924, member: 338656"]
Try this in V2:

[CODE=xls]=IFERROR(SUM(AGGREGATE({14,15},6,COLUMN(B2:R2)/(B2:R2>0),1)*{1,-1})+1,0)
If I want to paste the provided formula in the expanded spreadsheet (Xl2bb pasted below) what modifications to the formula must I make? I added 3 columns before the data set and this is causing the result to be overstated by 3. Please advise what else I need to be sensitive to if my data sets dates are expanding or columns are being added before my data set. Thanks
[/QUOTE]

Counts (34).xlsx
ABCDEFGHIJKLMNOPQRSTUVWXYZAAABACADAEAFAGAHAIAJAKALAMANAOAPAQARASATAUAVAWAXAYAZBABBBCBDBEBFBGBHBIBJBKBLBMBNBOBPBQBRBSBTBUBVBWBXBYBZCACBCCCDCECFCGCHCICJCKCLCMCNCOCPCQCRCSCTCUCVCWCXCYCZDADBDCDDDEDFDGDHDIDJDKDLDMDNDODPDQDRDSDTDUDVDWDXDYDZEAEBECEDEEEFEGEHEIEJEKELEMENEOEPEQERESETEUEVEWEXEYEZFAFBFCFDFEFFFGFHFIFJFKFLFMFNFOFPFQFRFSFTFUFVFWFXFYFZGAGBGCGDGEGFGGGHGIGJGKGL
1Meter IDFacilityFirstLast2021-01-172021-01-182021-01-192021-01-202021-01-212021-01-222021-01-232021-01-242021-01-252021-01-262021-01-272021-01-282021-01-292021-01-302021-01-312021-02-012021-02-022021-02-032021-02-042021-02-052021-02-062021-02-072021-02-082021-02-092021-02-102021-02-112021-02-122021-02-132021-02-142021-02-152021-02-162021-02-172021-02-182021-02-192021-02-202021-02-212021-02-222021-02-232021-02-242021-02-252021-02-262021-02-272021-02-282021-03-012021-03-022021-03-032021-03-042021-03-052021-03-062021-03-072021-03-082021-03-092021-03-102021-03-112021-03-122021-03-132021-03-142021-03-152021-03-162021-03-172021-03-182021-03-192021-03-202021-03-212021-03-222021-03-232021-03-242021-03-252021-03-262021-03-272021-03-282021-03-292021-03-302021-03-312021-04-012021-04-022021-04-032021-04-042021-04-052021-04-062021-04-072021-04-082021-04-092021-04-102021-04-112021-04-122021-04-132021-04-142021-04-152021-04-162021-04-172021-04-182021-04-192021-04-202021-04-212021-04-222021-04-232021-04-242021-04-252021-04-262021-04-272021-04-282021-04-292021-04-302021-05-012021-05-022021-05-032021-05-042021-05-052021-05-062021-05-072021-05-082021-05-092021-05-102021-05-112021-05-122021-05-132021-05-142021-05-152021-05-162021-05-172021-05-182021-05-192021-05-202021-05-212021-05-222021-05-232021-05-242021-05-252021-05-262021-05-272021-05-282021-05-292021-05-302021-05-312021-06-012021-06-022021-06-032021-06-042021-06-052021-06-062021-06-072021-06-082021-06-092021-06-102021-06-112021-06-122021-06-132021-06-142021-06-152021-06-162021-06-172021-06-182021-06-192021-06-202021-06-212021-06-222021-06-232021-06-242021-06-252021-06-262021-06-272021-06-282021-06-292021-06-302021-07-012021-07-022021-07-032021-07-042021-07-052021-07-062021-07-072021-07-082021-07-092021-07-102021-07-112021-07-122021-07-132021-07-142021-07-152021-07-162021-07-172021-07-182021-07-192021-07-202021-07-212021-07-22TotalCountSpan of days
20657562UnnassignedUnnassignedUnnassigned2323333353333333343333333333333333333333333333323333333233233331333334333343333333333333333334331433333432131122323111322121348124188
30661648UnnassignedUnnassignedUnnassigned111111111111111111111111111111111111111111111121111111111111111111111111111111111111111111111111111111111111111112222222222222222222122222222222222222222222199156163
40661655UnnassignedUnnassignedUnnassigned11111111111111111111111111111571124415437156
50675861UnnassignedUnnassignedUnnassigned111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111165165187
60774458UnnassignedUnnassignedUnnassigned000
Excel forum
Cell Formulas
RangeFormula
GK2:GK6GK2=COUNT(E2:GI2)
GL2:GL6GL2=IFERROR(COLUMN($GI$2)-AGGREGATE(15,6,(COLUMN($E$1:$GI$1)-COLUMN($E$1)+1)/(E2:GI2<>""),1),0)


FERROR(SUM(AGGREGATE({14,15},6,COLUMN(B2:R2)/(B2:R2>0),1)*{1,-1})+1,0)[/CODE]
 
Upvote 0
If I want to paste the provided formula in the expanded spreadsheet (Xl2bb pasted below) what modifications to the formula must I make? I added 3 columns before the data set and this is causing the result to be overstated by 3. Please advise what else I need to be sensitive to if my data sets dates are expanding or columns are being added before my data set. Thanks

Counts (34).xlsx
ABCDEFGHIJKLMNOPQRSTUVWXYZAAABACADAEAFAGAHAIAJAKALAMANAOAPAQARASATAUAVAWAXAYAZBABBBCBDBEBFBGBHBIBJBKBLBMBNBOBPBQBRBSBTBUBVBWBXBYBZCACBCCCDCECFCGCHCICJCKCLCMCNCOCPCQCRCSCTCUCVCWCXCYCZDADBDCDDDEDFDGDHDIDJDKDLDMDNDODPDQDRDSDTDUDVDWDXDYDZEAEBECEDEEEFEGEHEIEJEKELEMENEOEPEQERESETEUEVEWEXEYEZFAFBFCFDFEFFFGFHFIFJFKFLFMFNFOFPFQFRFSFTFUFVFWFXFYFZGAGBGCGDGEGFGGGHGIGJGKGL
1Meter IDFacilityFirstLast2021-01-172021-01-182021-01-192021-01-202021-01-212021-01-222021-01-232021-01-242021-01-252021-01-262021-01-272021-01-282021-01-292021-01-302021-01-312021-02-012021-02-022021-02-032021-02-042021-02-052021-02-062021-02-072021-02-082021-02-092021-02-102021-02-112021-02-122021-02-132021-02-142021-02-152021-02-162021-02-172021-02-182021-02-192021-02-202021-02-212021-02-222021-02-232021-02-242021-02-252021-02-262021-02-272021-02-282021-03-012021-03-022021-03-032021-03-042021-03-052021-03-062021-03-072021-03-082021-03-092021-03-102021-03-112021-03-122021-03-132021-03-142021-03-152021-03-162021-03-172021-03-182021-03-192021-03-202021-03-212021-03-222021-03-232021-03-242021-03-252021-03-262021-03-272021-03-282021-03-292021-03-302021-03-312021-04-012021-04-022021-04-032021-04-042021-04-052021-04-062021-04-072021-04-082021-04-092021-04-102021-04-112021-04-122021-04-132021-04-142021-04-152021-04-162021-04-172021-04-182021-04-192021-04-202021-04-212021-04-222021-04-232021-04-242021-04-252021-04-262021-04-272021-04-282021-04-292021-04-302021-05-012021-05-022021-05-032021-05-042021-05-052021-05-062021-05-072021-05-082021-05-092021-05-102021-05-112021-05-122021-05-132021-05-142021-05-152021-05-162021-05-172021-05-182021-05-192021-05-202021-05-212021-05-222021-05-232021-05-242021-05-252021-05-262021-05-272021-05-282021-05-292021-05-302021-05-312021-06-012021-06-022021-06-032021-06-042021-06-052021-06-062021-06-072021-06-082021-06-092021-06-102021-06-112021-06-122021-06-132021-06-142021-06-152021-06-162021-06-172021-06-182021-06-192021-06-202021-06-212021-06-222021-06-232021-06-242021-06-252021-06-262021-06-272021-06-282021-06-292021-06-302021-07-012021-07-022021-07-032021-07-042021-07-052021-07-062021-07-072021-07-082021-07-092021-07-102021-07-112021-07-122021-07-132021-07-142021-07-152021-07-162021-07-172021-07-182021-07-192021-07-202021-07-212021-07-22TotalCountSpan of days
20657562UnnassignedUnnassignedUnnassigned2323333353333333343333333333333333333333333333323333333233233331333334333343333333333333333334331433333432131122323111322121348124188
30661648UnnassignedUnnassignedUnnassigned111111111111111111111111111111111111111111111121111111111111111111111111111111111111111111111111111111111111111112222222222222222222122222222222222222222222199156163
40661655UnnassignedUnnassignedUnnassigned11111111111111111111111111111571124415437156
50675861UnnassignedUnnassignedUnnassigned111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111165165187
60774458UnnassignedUnnassignedUnnassigned000
Excel forum
Cell Formulas
RangeFormula
GK2:GK6GK2=COUNT(E2:GI2)
GL2:GL6GL2=IFERROR(COLUMN($GI$2)-AGGREGATE(15,6,(COLUMN($E$1:$GI$1)-COLUMN($E$1)+1)/(E2:GI2<>""),1),0)

[/QUOTE]
Sorry. I pasted the wrong formula. It seems the formula you provided is not sensitive to adding columns before the data set.
 
Upvote 0
Try the formula I provided in post 4, changing the columns as necessary:

Excel Formula:
=IFERROR(SUM(AGGREGATE({14,15},6,COLUMN(E2:GI2)/(E2:GI2>0),1)*{1,-1})+1,0)
 
Upvote 0

Forum statistics

Threads
1,214,535
Messages
6,120,090
Members
448,944
Latest member
sharmarick

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