Formulas and Functions

Formulas and Functions

Ask for help with your formula and find examples of how others use formulas and functions to solve a similar problem.

MAX(COLLECT FROM MULTIPLE SHEETS

✭✭✭✭✭
edited 07/19/22 in Formulas and Functions

Because I maxed-out on multiple sheet references, I had to break up one large sheet into 3 smaller ones in order to collect the data I need. I am trying to get the last patient visit from 3 different sheets. The sheets are broken up by the year of the initial patient visit.

My formula works for some patients but not for others. I am getting an INVALID DATA TYPE error. I cannot find out why the formula works for some but not for others. There doesn't seem to be a pattern. My formula is below:

=MAX(COLLECT({Lebanon D/C & CL - PVTL: 2018 - 20 DOV}, {Lebanon D/C & CL - PVTL: 2018 - 20 BC}, BARCODE@row), MAX(COLLECT({Lebanon | PVTL D/C & CL 22 DOV}, {Lebanon | PVTL D/C & CL 22 BC}, BARCODE@row), MAX(COLLECT({Lebanon D/C & CL - PVTL: 2021 DOV}, {Lebanon D/C & CL - PVTL: 2021 BC}, BARCODE@row))))

I have also tried using IFERROR and that results in getting some LAST VISITS but not others. I have attached a section one of the data source sheets. I am trying to get the data from 3 different sheets that are all exactly alike.

Thanks in advance.



Answers

Help Article Resources

Want to practice working with formulas directly in Smartsheet?

Check out the Formula Handbook template!

Trending in Formulas and Functions