IF cells in column A contains a dates that are 7 days before todays date then output the date and the value in the coulumn next to it in a list

Sifuevs

New Member
Joined
May 8, 2015
Messages
25
Office Version
  1. 365
Platform
  1. Windows
I have a vehicle compliance sheet. Column A contains dates of next vehicle inspection. Column B contains vehicle registration numbers. I am looking for a formula that will look up dates in column A that are 7 days prior to todays date and then output a list of these dates and the corresponding vehicle reg in column B.

When returning the values i would like this list also to be in date order from nearest date to today and so forth.


Additionally to this i would like the same formula as above but column A contains mileage and instead i would like to look up mileage and base the results on 500 miles less than the mileage in column A.

I hope this makes sense. I have basic Excel knowledge but this is a challenge for me.

Thanks so much in advance for any help.
 

Excel Facts

Select all contiguous cells
Pressing Ctrl+* (asterisk) will select the "current region" - all contiguous cells in all directions.
what version of excel are you using

filter will work

=SORT(FILTER(A2:B29,A2:A29<TODAY()+7))

i'm assuming prior means in advance
so totday is 6th dec
and so 7 days is the 13th

so list is from 13th dec backwards showing dates before 13th

=SORT(FILTER(A2:B29,A2:A29<TODAY()+7))

Book2
ABCDEF
1
212/1/23A112/1/23A1
312/2/23A212/2/23A2
412/3/23A312/3/23A3
512/4/23A412/4/23A4
612/5/23A512/5/23A5
712/6/23A612/6/23A6
812/7/23A712/7/23A7
912/8/23A812/8/23A8
1012/9/23A912/9/23A9
1112/10/23A1012/10/23A10
1212/11/23A1112/11/23A11
1312/12/23A1212/12/23A12
1412/13/23A13
1512/14/23A14
1612/15/23A15
1712/16/23A16
1812/17/23A17
1912/18/23A18
2012/19/23A19
2112/20/23A20
2212/21/23A21
2312/22/23A22
2412/23/23A23
2512/24/23A24
2612/25/23A25
2712/26/23A26
2812/27/23A27
2912/28/23A28
Sheet1
Cell Formulas
RangeFormula
E2:F13E2=SORT(FILTER(A2:B29,A2:A29<TODAY()+7))
Dynamic array formulas.



mileage - is + or - 500 from a number you enter
=FILTER(A2:B22,(A2:A22>D2-500)*(A2:A22<D2+500))

Book2
ABCDEF
1
210000a11175011500a7
310250a211750a8
410500a312000a9
510750a4
611000a5
711250a6
811500a7
911750a8
1012000a9
1112250a10
1212500a11
1312750a12
1413000a13
1513250a14
1613500a15
1713750a16
1814000a17
1914250a18
2014500a19
2114750a20
2215000a21
Sheet2
Cell Formulas
RangeFormula
E2:F4E2=FILTER(A2:B22,(A2:A22>D2-500)*(A2:A22<D2+500))
Dynamic array formulas.
 
Upvote 0

Forum statistics

Threads
1,215,097
Messages
6,123,076
Members
449,094
Latest member
mystic19

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