Forum Discussion

Seaneboy2020's avatar
Seaneboy2020
Copper Contributor
Dec 02, 2020

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

 

  • mathetes's avatar
    mathetes
    Silver Contributor

    Seaneboy2020 

     

    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.

    • Seaneboy2020's avatar
      Seaneboy2020
      Copper Contributor

      mathetes 

       

      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.

      • Twifoo's avatar
        Twifoo
        Silver Contributor

        Seaneboy2020 

        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.

Resources