Forum Discussion
Seaneboy2020
Dec 02, 2020Copper Contributor
LOOKUP FORMULA BASED ON HEADERS
Hello,
I have some data, which consists of account numbers (rows) by month (headers).
I'm attempting to create a formula that will return the value of a cell based on the date I enter. For example, if I enter Nov 20, I want the formula to search for that date in the headers and return the values of the account numbers in that column, for Nov 20.
So far I have tried using INDEX & MATCH, VLOOKUP with an MATCH function and SUMIFS, but none of these have worked.
Could anyone suggest any other formulas which may work?
Thanks
- mathetesSilver Contributor
You could go a long way toward helping us help you by posting a copy (or a representative sample) of your spreadsheet. Your verbal description is confusing.
An actual sample of the spreadsheet itself is better than an image, and would also enable somebody here to write a formula that works and post it for you to use.
- Seaneboy2020Copper Contributor
Thank you for your message.
I have included an example of the spreadsheet, as requested.
I am trying to populate the cells of column N, with the values in column I. I want to use the date in cell P1, as the search criteria. So any the values of any cells contained within a column, where the dates agree are shown in column N.
If you need any further information, please let me know.
Thank you.
- TwifooSilver Contributor
I suggest this formula in O2 of the attached version of your file:
=INDEX(ColumnsLeft, MATCH(Q$1,HeadersLeft,0))
ColumnsLeft refers to:
=Schedule!$B2:N2
HeadersLeft refers to:
=Schedule!$B$1:N$1
Kindly notice these:
1. I modified the formula starting in C1 to this:
=EOMONTH(B1,1)
2. I inserted a column for April 2021, with simulated values thereunder.
3. You can also insert a column for May 2021 to test the dynamic attribute of ColumnsLeft and HeadersLeft.