Find Leftmost cell in defined range and return column distance.

dovl

New Member
Joined
Apr 6, 2021
Messages
16
Office Version
  1. 2019
Platform
  1. Windows
I am looking for a formula that can tell me the "days since activation"(number found in column "U") . Each number represents "times used on given day", if blank, that means it wasn't used that day. I want this formula to work even when there will be gaps of data, indicating non use (e.g. Row 4). I Highlighted Yellow the cells which represent the activation of device (first use). In this example I counted the amount of cells (days) through column R.

Since I have the dates listed on Row 1, a second formula that would be helpful is, to find the leftmost cell from defined range (activation date) then grab the corresponding date from row 1 and return number of days to "todays date" and disregard the date in column R.

Any assistance will be greatly appreciated.

Thanks

1617717750876.png
 

Excel Facts

How to fill five years of quarters?
Type 1Q-2023 in a cell. Grab the fill handle and drag down or right. After 4Q-2023, Excel will jump to 1Q-2024. Dash can be any character.
You're welcome & thanks for the feedback.
 
Upvote 0
Ok, how about
Excel Formula:
=IFERROR(COLUMN($R$2)-AGGREGATE(15,6,(COLUMN($B$1:$R$1)-COLUMN($B$1)+1)/(B2:R2<>""),1),0)
Hi Fluff, would you be kind enough to help me with one more formula on this? I'm looking for a formula to calculate the span of days between the first use and last use. In the pasted image, I'm looking for a formula for column V. In row 7, first date of activity was 1/23/2021, it was dormant for a few days and then had activity through 02/01/2021. So span of days of activity (1.23 through 2.1) is 10 days. Can you help me with a formula that searches for first day, and then provides the span of days through last day of use? Much Appreciated

1620414257478.png
 
Upvote 0
As this is a totally different question, it needs a new thread. Thanks
 
Upvote 0
I have a follow up question on the formula provided above "=IFERROR(COLUMN($DD$2)-AGGREGATE(15,6,(COLUMN($E$1:$DD$1)-COLUMN($E$1)+1)/(E2:DD2<>""),1),0)" I applied it to a larger data set (pasted below) and it seems it comes back 3 numbers higher then it should. Any idea why? I noticed this, because I used a separate formula to find the span of days. But that formula should equal the same as my requested formula, when the device is used through the last day (column) of the data set. and it seems the formula in Column DH consistently yields 3 numbers higher then it should. Thank you.

De-identified Copy.xlsx
DEFGHIJKLMNOPQRSTUVWXYZAAABACADAEAFAGAHAIAJAKALAMANAOAPAQARASATAUAVAWAXAYAZBABBBCBDBEBFBGBHBIBJBKBLBMBNBOBPBQBRBSBTBUBVBWBXBYBZCACBCCCDCECFCGCHCICJCKCLCMCNCOCPCQCRCSCTCUCVCWCXCYCZDADBDCDDDEDFDGDHDIDJDKDLDMDN
1Device ID2021-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-30TotalTo date CountThrough 4.30Span of daysDiff# of cycles
212323333353333333343333333333333333333333333333323333333233233331333334333343333333333333333334331432297108100105102Why arent they equal53
321111111111111111111111111111111111111111111111211111111111111111111111111768373807772
4311111111111111111111111111113076287330451
5522222322222222222222222222222222222222222222222222222222222222222221222221598573827392
Meter Counts
Cell Formulas
RangeFormula
DF2:DF5DF2=IFERROR(TODAY()-INDEX($E$1:$DD$1,AGGREGATE(15,6,(COLUMN($E$1:$DD$1)-COLUMN($E$1)+1)/(E2:DD2<>""),1)),"")
DG2:DG5DG2=COUNT(E2:DD2)
DH2:DH5DH2=IFERROR(COLUMN($DD$2)-AGGREGATE(15,6,(COLUMN($E$1:$DD$1)-COLUMN($E$1)+1)/(E2:DD2<>""),1),0)
DI2:DI5DI2=IFERROR(SUM(AGGREGATE({14,15},6,COLUMN(E2:DD2)/(E2:DD2>0),1)*{1,-1})+1,0)
DN5,DN2:DN3DN2=ROUNDDOWN((DH2/30),0)
DM2:DM5DM2=DH2-DG2
 
Upvote 0
Because you first column is now 3 columns to the right of where it was originally ie col E instead of col B
 
Upvote 0
Because you first column is now 3 columns to the right of where it was originally ie col E instead of col B
Thank you. I didn't fully understand the formula but I just copied and modified per my new sheet. I did however, change the range to reflect columns E through DD for the formula vs your original range of B through R. Shouldn't that address the issue of starting 3 columns in? If not, how can I modify the formula to accommodate added rows before the table.

Much appreciated.
 
Upvote 0
As long as the dates in row 1 are always sequential you can use this
Excel Formula:
=IFERROR($DD$1-AGGREGATE(15,6,$E$1:$DD$1/(E2:DD2<>""),1)+1,0)
 
Upvote 0

Forum statistics

Threads
1,214,648
Messages
6,120,726
Members
448,987
Latest member
marion_davis

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