You can make a difference in the Apple Support Community!

When you sign up with your Apple Account, you can provide valuable feedback to other community members by upvoting helpful replies and User Tips.

Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Return values from another table between dates and specific text

I have started a personal finance budget and have a "Master Projections" table, an "18-month Budget" table with projected vs. actual budget values, and a "Transactions" table. I want to keep the master ongoing so that I can create new and edit current monthly budgets as required. My "18-month Budget" pulls actual budget values from the "Transactions" table, but I would like the projected values to be pulled from my "Master Projections" table. I also have the "18-month Budget" set up so that I can select the start date and it will adjust to any 18-month period. Actuals is fine, however, I don't know how to compensate for the change in month for the projected values. The Lookup Function works for the employer, but unsure how to incorporate the month heading. They are set up as different sheets in my file, but I put them together in the attachment for ease of explanation. Thanks for any help :)

Posted on May 12, 2020 5:29 AM

Reply
Question marked as Top-ranking reply

Posted on May 12, 2020 7:12 PM

MATCH and INDEX should work for the example provided.


LOOKUP will always accept a 'close match', defined as the largest value less than or equal to the search-for value.


VLOOKUP, or in this case, HLOOKUP can be set to accept a 'close match; or demand an 'exact match,' but this won't help here, where the search-for value in the first of a month, and the expected match is the 20th of the same month.


Enter MATCH, the most flexible of the search functions.


Match has three settings: Find Largest—which is the same as 'close match' in the functions above, 'Find value'—effectively the same as 'Exact match', and Find Smallest, which searches for the 'smallest value greater than or equal to' the search-for value.


MATCH searches a range for the best value to fit that description, and reurns a number indicating the position of that value in the list contained in the specified range.


Working with INDEX, MATCH can return that number as the Column-index, and Index will return the value in that column of the specified row.




The "I want…" pointer is to cell C6 of "Table 1". For this cell, the statements below apply:


The search-for value to determine the row from which the data is to be returned is in cell B6 of Table 1.

The best match is to be found in column B of Table 2.

The search-for value to determine the column is the date in C1 of Table 1.

The best match is to be found in Row 1 of Table 2.


Translating those to a formula:


C6: =INDEX(Table 2::A:Z,MATCH($B6,Table 2:$B,0),MATCH(C$1,Table 2::$1:$1,-1)


A:Z assumes the last column of Table 2 is column Z.

The 0 in the first MATCH is 'Find value.'

The -1 in the second MATCH is 'Find Smallest'.


I've not yet tested this, and won't have an opportunity to do so for a few hours.


Try it in C6, and report any mishaps. Will expand to apply to other cells later today.


Regards,

Barry

Similar questions

3 replies
Question marked as Top-ranking reply

May 12, 2020 7:12 PM in response to corinne1972

MATCH and INDEX should work for the example provided.


LOOKUP will always accept a 'close match', defined as the largest value less than or equal to the search-for value.


VLOOKUP, or in this case, HLOOKUP can be set to accept a 'close match; or demand an 'exact match,' but this won't help here, where the search-for value in the first of a month, and the expected match is the 20th of the same month.


Enter MATCH, the most flexible of the search functions.


Match has three settings: Find Largest—which is the same as 'close match' in the functions above, 'Find value'—effectively the same as 'Exact match', and Find Smallest, which searches for the 'smallest value greater than or equal to' the search-for value.


MATCH searches a range for the best value to fit that description, and reurns a number indicating the position of that value in the list contained in the specified range.


Working with INDEX, MATCH can return that number as the Column-index, and Index will return the value in that column of the specified row.




The "I want…" pointer is to cell C6 of "Table 1". For this cell, the statements below apply:


The search-for value to determine the row from which the data is to be returned is in cell B6 of Table 1.

The best match is to be found in column B of Table 2.

The search-for value to determine the column is the date in C1 of Table 1.

The best match is to be found in Row 1 of Table 2.


Translating those to a formula:


C6: =INDEX(Table 2::A:Z,MATCH($B6,Table 2:$B,0),MATCH(C$1,Table 2::$1:$1,-1)


A:Z assumes the last column of Table 2 is column Z.

The 0 in the first MATCH is 'Find value.'

The -1 in the second MATCH is 'Find Smallest'.


I've not yet tested this, and won't have an opportunity to do so for a few hours.


Try it in C6, and report any mishaps. Will expand to apply to other cells later today.


Regards,

Barry

May 12, 2020 9:25 PM in response to corinne1972

OK.


Some questions:


What is the actual date and time value behind this 'date'? What does 'These dates…will never change" mean?

What values do you "want to be able to edit", "and have the table above change also"?


I'm not certain I'm on the right track in my previous post. I'll wai for more details regarding these quetions and smilar ons regarding the actual content (as opposed to 'displayed' content' of the cells in the tables.


Regards,

Barry

May 13, 2020 5:09 AM in response to Barry

Hi Barry,


Thanks so much. Works like a charm. Now the only thing I'm trying to figure out is how to have the Index function refer to newly added columns in the "Master Projections" table. If I add columns for new months, and I change the start date on the "18-month Budget" the new months show errors because the range in the Index function does not include the newly added columns. Maybe this will explain my goal a bit better...my "Master Projections" table will never have deleted or edited months/dates, but will have future ones added (which I hope answers your question below). And the "18-month Budget" I would like to be a "rolling" 18-month period starting with the date I enter in the "BUDGET START" cell pulling from the "Master Projections" table. Thanks again!!!


Corinne

Return values from another table between dates and specific text

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.