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

  • jmyzk_cloudsmart_jp
    jmyzk_cloudsmart_jp ✭✭✭✭✭✭
    edited 07/05/24 Answer ✓

    Hi @Alexandra Amies

    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.)


Help Article Resources

Want to practice working with formulas directly in Smartsheet?

Check out the Formula Handbook template!