Check if date is in sequencial order in all sheets

AriannaVV

New Member
Joined
Aug 6, 2017
Messages
34
Office Version
  1. 365
Platform
  1. Windows
Hi all.
I have a workbook with 31 sheets. In each sheet I have a title like: Line 364 _ Central Park, Beach, Monday 01.08.2023. The format is dd.mm.yyyy. The date changes sequencial for each sheet. Let's say if the first sheet is ...Monday 01.08.2023 next sheet is Tuesday 02.08.2023. I need to check if the dates in all sheets are in sequencial order and there is no error in them (like different month for example "01.07.2023"). If there is an error the code should stop and a pop up message tell the sheet where the error is.

Can someone help please?
 
For example I named my first 3 sheets respectively 1,2 and 3
B3 returns if it is sequential. Assumed your text is in F3 on every sheet.

hulp tijden (3).xlsx
BCDEFGHIJKLM
2Sequential?
3TRUELINE 365 - CENTRAL PARK, 3rd AVENUE, Saturday 07-07-2023
4
5
1
Cell Formulas
RangeFormula
B3B3=LET(z,--RIGHT(VSTACK('1:3'!F3),10),MAX(z-VSTACK(TAKE(z,1)-1,DROP(z,-1)))=1)
This formula returns a #name error. What is the z?
 
Upvote 0

Excel Facts

Copy PDF to Excel
Select data in PDF. Paste to Microsoft Word. Copy from Word and paste to Excel.
You probably have to translate the formula. "z" is just a variable
 
Upvote 0

Attachments

  • NAME.JPG
    NAME.JPG
    28.4 KB · Views: 8
Upvote 0
Must be a language issue or you don’t have the new functions
 
Upvote 0
Must be a language issue or you don’t have the new functions
You are right. Sorry my mistake. I tested the formula on an older excel version. oops! It works great on 365. Just another one thing. Sometimes I have to check 15 sheets and others I have to check the whole month and that is 30 or 31 sheets depending on month. Is it possible to change the formula to dynamically include new sheets added rather than change it all the time? Thanks!!!
 
Upvote 0
Ok, put this formula in the name manager and name it as "all_sheets"

Excel Formula:
=TOCOL(TEXTAFTER(GET.WORKBOOK(1);"]"))

Then you could use this formula

Excel Formula:
=LET(r;DROP(REDUCE("";all_sheets;LAMBDA(a;b;VSTACK(a;INDIRECT("'"&b&"'!F3"))));1);z;--RIGHT(r;10);MAX(z-VSTACK(TAKE(z;1)-1;DROP(z;-1)))=1)
 
Upvote 0
Ok, put this formula in the name manager and name it as "all_sheets"

Excel Formula:
=TOCOL(TEXTAFTER(GET.WORKBOOK(1);"]"))

Then you could use this formula

Excel Formula:
=LET(r;DROP(REDUCE("";all_sheets;LAMBDA(a;b;VSTACK(a;INDIRECT("'"&b&"'!F3"))));1);z;--RIGHT(r;10);MAX(z-VSTACK(TAKE(z;1)-1;DROP(z;-1)))=1)
The first formula returns an error message that says "This formula isn't valid"
 
Last edited:
Upvote 0
Yes but you have to put that formula directly in the name manager. Otherwise it will not work.
See previous post
 
Upvote 0
Yes but you have to put that formula directly in the name manager. Otherwise it will not work.
See previous post
ok. I did so, but now the second formula returns #VALUE error. At first I though that this was because of a sheet named "WORKS" that does not include the header so I changed it's name and copied the header. But the error remains. hmm, that is more complicated than I thought it would be.
 
Upvote 0
How did you name the formula in the name manager? It has to be exactly “all_sheets”
 
Upvote 0

Forum statistics

Threads
1,215,375
Messages
6,124,580
Members
449,174
Latest member
chandan4057

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