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
- Smartsheet Customer Resources
- 64.1K Get Help
- 412 Global Discussions
- 221 Industry Talk
- 459 Announcements
- 4.8K Ideas & Feature Requests
- 143 Brandfolder
- 141 Just for fun
- 58 Community Job Board
- 461 Show & Tell
- 31 Member Spotlight
- 1 SmartStories
- 299 Events
- 38 Webinars
- 7.3K Forum Archives
Check out the Formula Handbook template!