Formula to return TRUE for date closest to final date for each change in chainage

AJLash

New Member
Joined
Apr 12, 2016
Messages
3
Office Version
  1. 365
  2. 2019
Platform
  1. Windows
Hi

Need some help from the brains trust. I have a spreadsheet that is the EXIF export from multiple image pickups over several captures at different dates (Col I) from a road where the images are aligned to road distance (Col E). I know for each picture what the date (Col K) is for when the best images should be kept. I need to identify the image for each Chainage Number (Col E) for which the date (Col I) is closest to the Best image Date (Col K). I have demonstrated a result in Col L.

Thankyou in advance

Screenshot 2021-02-02 074231.jpg
 

Excel Facts

Whats the difference between CONCAT and CONCATENATE?
The newer CONCAT function can reference a range of cells. =CONCATENATE(A1,A2,A3,A4,A5) becomes =CONCAT(A1:A5)
Map1
ABCDEFGHIJKL
1ChainageDateDateFinalisedBest Image
2907-2-202031-10-2019WAAR
39020-4-202031-10-2019ONWAAR
41007-2-202031-10-2019WAAR
510020-4-202031-10-2019ONWAAR
61103-10-201931-10-2019ONWAAR
711028-10-201931-10-2019WAAR
811020-4-202031-10-2019ONWAAR
Blad1
Cell Formulas
RangeFormula
L2:L8L2=SUMPRODUCT(((SMALL(($E$2:$E$8=E2)*ABS($I$2:$I$8-$K$2:$K$8),COUNTIF($E$2:$E$8,"<>"&E2)+1)=(ABS($I$2:$I$8-$K$2:$K$8)*($E$2:$E$8=E2)))*ROW($E$2:$E$8)))=ROW()
Press CTRL+SHIFT+ENTER to enter array formulas.
 
Upvote 0
Map1
ABCDEFGHIJKL
1ChainageDateDateFinalisedBest Image
2907-2-202031-10-2019WAAR
39020-4-202031-10-2019ONWAAR
41007-2-202031-10-2019WAAR
510020-4-202031-10-2019ONWAAR
61103-10-201931-10-2019ONWAAR
711028-10-201931-10-2019WAAR
811020-4-202031-10-2019ONWAAR
Blad1
Cell Formulas
RangeFormula
L2:L8L2=SUMPRODUCT(((SMALL(($E$2:$E$8=E2)*ABS($I$2:$I$8-$K$2:$K$8),COUNTIF($E$2:$E$8,"<>"&E2)+1)=(ABS($I$2:$I$8-$K$2:$K$8)*($E$2:$E$8=E2)))*ROW($E$2:$E$8)))=ROW()
Press CTRL+SHIFT+ENTER to enter array formulas.
Thanks Mark - works great. Would you be able to tweak it that if TRUE is returned and the image date is more than 10 days before the Date Finalised then a FALSE is returned?
 
Upvote 0
Found an issue with formula when down in the chainage 4160 the formula has no reliability and randomly calculates- any ideas?

Screenshot 2021-02-03 120842.jpg
 
Upvote 0
@AJLash
In order to get the best answers & fastest I suggest for the future you attend to these two things:
  • Update your Account details (click your user name at the top right of the forum) so helpers always know what Excel version(s) & platform(s) you are using as the best solution often varies by version. (Don’t forget to scroll down & ‘Save’)
  • Investigate XL2BB for providing sample data to make it easier for helpers by not having to manually type out sample data to test with.

See if these are any use

21 02 03.xlsm
EIKLM
1ChainageDateDateFinalisedOriginal QuestionTweak
2907/02/202031/10/2019TRUETRUE
39020/04/202031/10/2019FALSEFALSE
41007/02/202031/10/2019TRUETRUE
510020/04/202031/10/2019FALSEFALSE
61103/10/201931/10/2019FALSEFALSE
711020/10/201931/10/2019TRUEFALSE
811020/04/202031/10/2019FALSEFALSE
TRUE
Cell Formulas
RangeFormula
L2:L8L2=ABS(K2-I2)=AGGREGATE(15,6,ABS(K$2:K$8-I$2:I$8)/(E$2:E$8=E2),1)
M2:M8M2=AND(K2-I2<11,ABS(K2-I2)=AGGREGATE(15,6,ABS(K$2:K$8-I$2:I$8)/(E$2:E$8=E2),1))
 
Upvote 0

Forum statistics

Threads
1,214,943
Messages
6,122,370
Members
449,080
Latest member
Armadillos

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