I have a Google sheets with a bunch of sheets for each vehicle type. Each sheet is formatted the exact same: column A is the unit number, column B is the inspection date, and column C is the status (Active or Inactive). I currently have a working query formula that pulls all the units in the entire workbook that have inspections which expire between 395 and 335 days ago (each inspection lasts 1 year). It also outputs the sheet name where it came from (more or less).
The problem I'm running into is that instead of pulling the inspection date, I want to add 1 year to the inspection date and then show that date (the date of expiration). How can I accomplish this? I have tried a bunch of different methods, but none seem to work. I've talked with ChatGPT and it isn't very helpful either.
So essentially, I need the output to be this: column 1 is sheet name where unit was pulled from, column 2 is unit #, column 3 is inspection expiration date.
=QUERY({ARRAYFORMULA(IF(LEN(Trucks!A1:A),"Truck",)),Trucks!A1:C;ARRAYFORMULA(IF(LEN(Flatbeds!A1:A),"Flatbed",)),Flatbeds!A1:C;ARRAYFORMULA(IF(LEN('Transport Trailers'!A1:A),"Transport Trailer",)),'Transport Trailers'!A1:C;ARRAYFORMULA(IF(LEN('End Dumps'!A1:A),"End Dump",)),'End Dumps'!A1:C;ARRAYFORMULA(IF(LEN('Side Dumps'!A1:A),"Side Dump",)),'Side Dumps'!A1:C;ARRAYFORMULA(IF(LEN('Alum. Belly Dumps'!A1:A),"Alum. Belly Dump",)),'Alum. Belly Dumps'!A1:C;ARRAYFORMULA(IF(LEN('Steel Belly Dumps'!A1:A),"Steel Belly Dump",)),'Steel Belly Dumps'!A1:C;ARRAYFORMULA(IF(LEN('Dump Pups'!A1:A),"Dump Pup",)),'Dump Pups'!A1:C;ARRAYFORMULA(IF(LEN('Light Vehicles'!A1:A),"Light Vehicle",)),'Light Vehicles'!A1:C},"Select Col1, Col2, Col3 where Col1 is not null AND Col4 = 'Active' AND Col3 >= DATE '"&TEXT(TODAY()-395, "yyyy-mm-dd")&"' AND Col3 <= DATE '"&TEXT(TODAY()-335, "yyyy-mm-dd")&"' order by Col3 ASC",0)