How to get the latest submission from a form entry using INDEX/MATCH
I am trying to bring across the latest submission from a pre start form to a main master sheet with up to date information.
Currently i am using the formula
=INDEX({Pre Start Check current hours}, MATCH([Rego/ EC]@row, {Pre Start Check Rego/ EC}, 0))
It brings across the information but doesn't update to the latest info as the forms are filled out.
So matching column Rego/ EC and updating current hours into new sheet. I have been told it involves COLLECT somehow i just am struggling to get it right.
Please can anybody help me with this.
Best Answer
-
If you can add a helper column, [Row ID], you can use the MAX(COLLECT()) formula to get the row_index for the latest submission.
=INDEX([Current Hours]:[Current Hours], MAX(COLLECT([Row ID]:[Row ID], [Reg/ EC]:[Reg/ EC], [Reg/ EC]#)))
or in you case as my demo uses the Sheet Summary Field instead of cross-sheet reference,
=INDEX({Pre Start Check current hours}, MAX(COLLECT({Pre Start Check Row ID}, {Pre Start Check Rego/ EC}, [Rego/ EC]@row)))
The formula aims to get the largest row number whose [Reg/ EC] value is the same as a specific Reg/ EC. (Thus, the Row ID must be the same as the row number.)
Answers
-
If you can add a helper column, [Row ID], you can use the MAX(COLLECT()) formula to get the row_index for the latest submission.
=INDEX([Current Hours]:[Current Hours], MAX(COLLECT([Row ID]:[Row ID], [Reg/ EC]:[Reg/ EC], [Reg/ EC]#)))
or in you case as my demo uses the Sheet Summary Field instead of cross-sheet reference,
=INDEX({Pre Start Check current hours}, MAX(COLLECT({Pre Start Check Row ID}, {Pre Start Check Rego/ EC}, [Rego/ EC]@row)))
The formula aims to get the largest row number whose [Reg/ EC] value is the same as a specific Reg/ EC. (Thus, the Row ID must be the same as the row number.)
-
That works :) Thank you so much!
Help Article Resources
Categories
- All Categories
- 14 Welcome to the Community
- Customer Resources
- 64.8K Get Help
- 437 Global Discussions
- 138 Industry Talk
- 470 Announcements
- 4.9K Ideas & Feature Requests
- 129 Brandfolder
- 148 Just for fun
- 65 Community Job Board
- 486 Show & Tell
- 33 Member Spotlight
- 2 SmartStories
- 300 Events
- 36 Webinars
- 7.3K Forum Archives
Check out the Formula Handbook template!