IF with INDEX function
I'm trying to elaborate a formula that only brings up a cell from a month of the year (ex: january) that is connected to the year we are at now (2023) and the year before (2022). So when we are in 2024, the cells of the months that come up are from the year 2024 and 2023, and etc. For this, I created a separate sheet, so this sheet in the image is just where the data is supposed to come from. I think I'll have to use the IF function and INDEX, but I don't know how.
Answers
-
I would use an INDEX/COLLECT (multiple criteria) or INDEX/MATCH (single criteria) for this.
The format for INDEX/MATCH is:
INDEX({create reference to remote sheet column you want to collect value from}, MATCH(value from cell or static value, {create reference to remote sheet column you want to match value from}, 0))
Follow Smartsheet's prompts to create the remote references as you create your INDEX formula. Select the column header when doing so in order to make the entire column the range.
So your formula would look something like this:
=INDEX({Source sheet Jan column range}, MATCH("2022", {Source sheet YEAR column range}, 0))
Repeat for 2023.
Regards,
Jeff Reisman
Link: Smartsheet Functions Help Pages Link: Smartsheet Formula Error Messages
If my answer helped solve your issue, please mark it as accepted so that other users can find it later. Thanks!
Help Article Resources
Categories
- All Categories
- 14 Welcome to the Community
- Customer Resources
- 64.9K Get Help
- 441 Global Discussions
- 140 Industry Talk
- 472 Announcements
- 4.9K Ideas & Feature Requests
- 129 Brandfolder
- 148 Just for fun
- 68 Community Job Board
- 496 Show & Tell
- 33 Member Spotlight
- 2 SmartStories
- 300 Events
- 36 Webinars
- 7.3K Forum Archives
Check out the Formula Handbook template!