Tying myself up in knots

Beau the dog

Board Regular
Joined
Mar 8, 2021
Messages
74
Office Version
  1. 365
Platform
  1. Windows
Hi,

I know this will be easy for you excel wizards, I'm tying myself up in knots.

We have a log, when I enter a new entry, I'd like the formula in the end column, to look for the last entry for that registration, and get the difference between the two ODO readings. The column header 'DATE' is in cell B6, there are no merged cells. Using latest version of excel.

Please and thank you!

DATEREGISTRATIONODOAdblue drawn (ltr)Depot / OCDriverOdometer difference
11-Apr-24GHY125420LondonHomer simpson
11-May-24GHY157830LondonHomer simpson
11-Apr-24YTR205680LiverpoolNed Flanders
11-May-24YTR345220LiverpoolNed Flanders
11-Jul-24GHY213630LondonHomer simpson
11-Jul-24YTR400060LiverpoolNed Flanders
 

Excel Facts

How to find 2nd largest value in a column?
MAX finds the largest value. =LARGE(A:A,2) will find the second largest. =SMALL(A:A,3) will find the third smallest
If your dates will always be in order for each reg, how about
Fluff.xlsm
ABCDEFG
1DATEREGISTRATIONODOAdblue drawn (ltr)Depot / OCDriverOdometer difference
211-Apr-24GHY125420LondonHomer simpson0
311-May-24GHY157830LondonHomer simpson324
411-Apr-24YTR205680LiverpoolNed Flanders0
511-May-24YTR345220LiverpoolNed Flanders1396
611-Jul-24GHY213630LondonHomer simpson558
711-Jul-24YTR400060LiverpoolNed Flanders548
Sheet5
Cell Formulas
RangeFormula
G2:G7G2=C2-XLOOKUP(B2,B$1:B1,C$1:C1,C2,,-1)
 
Upvote 0
Solution
If your dates will always be in order for each reg, how about
Fluff.xlsm
ABCDEFG
1DATEREGISTRATIONODOAdblue drawn (ltr)Depot / OCDriverOdometer difference
211-Apr-24GHY125420LondonHomer simpson0
311-May-24GHY157830LondonHomer simpson324
411-Apr-24YTR205680LiverpoolNed Flanders0
511-May-24YTR345220LiverpoolNed Flanders1396
611-Jul-24GHY213630LondonHomer simpson558
711-Jul-24YTR400060LiverpoolNed Flanders548
Sheet5
Cell Formulas
RangeFormula
G2:G7G2=C2-XLOOKUP(B2,B$1:B1,C$1:C1,C2,,-1)

They should be in date, it will only be human error if not, and that's a 'me' problem!

Thank you as always.
 
Upvote 0
You're welcome & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,221,709
Messages
6,161,431
Members
451,705
Latest member
Priti_190

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