Formula Help to count dates between matching outcomes

jec86

New Member
Joined
Feb 11, 2021
Messages
2
Office Version
  1. 365
Platform
  1. Windows
Hello all! I'm trying find the correct formula to deliver a counted value for the amount of time that has passed since the last time a desired value was shown. For instance, today is 2/11/2021 and I'm trying to figure out how many days have past since the last time "3" was realized. 20 would be the correct amount of days that the formula should solve for (2/11/2021 through 1/23/2021). Anyone have a simple formula to accomplish this?

Capture.PNG
 

Excel Facts

Can Excel fill bagel flavors?
You can teach Excel a new custom list. Type the list in cells, File, Options, Advanced, Edit Custom Lists, Import, OK
Welcome to the board! Here is one approach...
MrExcel20210209.xlsx
ABCDEF
1DateNumberSearch for -->320<-- Days since
22/11/20217
32/10/20210
42/9/20214
52/8/20215
62/7/20218
72/6/20214
82/5/20216
92/4/20214
102/3/20217
112/2/20215
122/1/20218
131/31/20212
141/30/20210
151/29/20215
161/28/20218
171/27/20217
181/26/20214
191/25/20212
201/24/20214
211/23/20219
221/22/20213
231/21/20215
241/20/20213
jec86
Cell Formulas
RangeFormula
E1E1=DAYS(A2,INDEX($A$2:$A$24,MATCH(D1,$B$2:$B$24,0)))
 
Upvote 0
Solution
That works too, provided no calendar days are missing from the list. If any days are skipped, an incorrect answer may be returned.
 
Upvote 0
Welcome to the board! Here is one approach...
MrExcel20210209.xlsx
ABCDEF
1DateNumberSearch for -->320<-- Days since
22/11/20217
32/10/20210
42/9/20214
52/8/20215
62/7/20218
72/6/20214
82/5/20216
92/4/20214
102/3/20217
112/2/20215
122/1/20218
131/31/20212
141/30/20210
151/29/20215
161/28/20218
171/27/20217
181/26/20214
191/25/20212
201/24/20214
211/23/20219
221/22/20213
231/21/20215
241/20/20213
jec86
Cell Formulas
RangeFormula
E1E1=DAYS(A2,INDEX($A$2:$A$24,MATCH(D1,$B$2:$B$24,0)))
Thanks KRice! This is exactly what I needed!
 
Upvote 0

Forum statistics

Threads
1,215,066
Messages
6,122,947
Members
449,095
Latest member
nmaske

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