Calculate number of days since last type of entry

Ironman

Well-known Member
Joined
Jan 31, 2004
Messages
1,069
Office Version
  1. 365
Platform
  1. Windows
Hi

The below range A8621:C8629 (but which starts from A12) shows 3 different types of entry in Column B: REST, OTHER and a route description (for running).

A2 (not shown) contains today's date
Excel Formula:
=TEXT(TODAY(),"d mmmm yyyy")

What I'd be very grateful for is a formula that will show the number of days since I last went running i.e. the latest date where Column B does not contain REST or OTHER.

For example, I last went running 4 days ago so I would expect the result to be 4 until I input today's running entry, when the result would change to 0.

Many thanks!

Wed, 28 Jul 2021Cullingworth Rd/Viaduct/ Stn Road/Old Allen Road Back Lane/Wilsden Rd/ Cottingley Rd/Lee Lane/ Cross Lane/Coplowe Ln/ Crack Lane/Main Street/ Harden Ln/Mill Hill Top/ Wilsden Rd/Mad Mile/ Greenside Lane (21/02/2020)10.6
Thu, 29 Jul 2021OTHER
Fri, 30 Jul 2021REST
Sat, 31 Jul 2021OTHER
Sun, 1 Aug 2021Cullingworth Rd/Viaduct/ Stn Road/Old Allen Road Back Lane/Wilsden Rd/ Cottingley Rd/Lee Lane/ Cross Lane/Coplowe Ln/ Crack Lane/Main Street/ Harden Ln/Mill Hill Top/ Wilsden Rd/Mad Mile/ Greenside Lane (21/02/2020)10.6
Mon, 2 Aug 2021OTHER
Tue, 3 Aug 2021REST
Wed, 4 Aug 2021OTHER
Thu, 5 Aug 2021Hallas Br/Down Bents Ln Harden Lane/Smithy Ln/ Lee Farm/Black Hills/ Golf Course/R down Beck Foot Lane/Wagon Lane/ Up LLC to cannon monument/Back to 3-Rise Locks & over Br/ Brown Cow/Main Road all the way back home (22/04/2007)15.4
 
Last edited:

Excel Facts

How to total the visible cells?
From the first blank cell below a filtered data set, press Alt+=. Instead of SUM, you will get SUBTOTAL(9,)
=IF(AND(C2<>"OTHER", C2<>"REST"), DAYS360(B2,A2, FALSE), "")
 
Upvote 0
Try:

Book1
ABC
1Days since I ran last
25 August 20210
3
4
5
6
7
8
9
10
11
127/28/2021asdf
137/29/2021other
147/30/2021rest
157/31/2021other
168/1/2021asdfasdf
178/2/2021other
188/3/2021rest
198/4/2021other
208/5/2021asdfasdf
218/6/2021
228/7/2021
238/8/2021
24
Sheet17
Cell Formulas
RangeFormula
A2A2=TEXT(TODAY(),"d mmmm yyyy")
C2C2=TODAY()-MAXIFS(A12:A9000,B12:B9000,"<>REST",B12:B9000,"<>OTHER",B12:B9000,"<>")
 
Upvote 0
Solution
Richh - Many thanks for your response. Unfortunately for some reason, I get the #VALUE error with your formula.

Eric - your solution works perfectly, many thanks.
 
Upvote 0

Forum statistics

Threads
1,223,234
Messages
6,170,891
Members
452,366
Latest member
TePunaBloke

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