+ Reply to Thread
Results 1 to 2 of 2

determining which of 12 columns to draw data from based upon a single variable

  1. #1
    Registered User
    Join Date
    02-05-2014
    Location
    san francisco, CA
    MS-Off Ver
    Excel 2010
    Posts
    1

    determining which of 12 columns to draw data from based upon a single variable

    Hello,

    First time doing this; hope this is the proper forum.

    I am working on a budget reporting package. The input page for managers has twelve columns (one for each month). At the start of the fiscal year, all columns are empty (zero). As the year progresses, the manager moves from left to right entering data for January in column E, then February in column F, then March in column G, etc.

    I created a counter that increases by one any time a manager inputs revenue data in months moving left to right (value in revenue cell >0 means the counter number increases by one). Using an if/then statement with a Date(2000,[counter cell],1) implement, I can account for the month to report based upon the counter number when that cell is custom formatted 'mmmm'. There are probably easier ways to do this but this is what I found worked.

    Ongoing issue:
    Now I need a single report page (to be re-used every month) to draw data from the column corresponding to the proper month. For example, if the counter value = 1, then I need this report to pull data from the 'January' column on the input tab. If the counter value = 2, pull from 'February' column, and so on.

    I can do one month by simply inputting =if((S5 [this is the cell the counter is estabished] = 1, then E6 [this corrosponds to the first revenue input cell in the 'January' column. However, i do not know how to 'stack' this type of calculation so that it functions as such:

    IF the [counter] number = 1, pull the data from the 'January' column OR IF the [counter] number = 2 then pull from the 'February' column OR IF the [counter] number =3, pull from the 'March' column and so on, up through the 12th possible counter number, corresponding to the 'December' column.

    It occurs to me that there might be a function somewhere where it could assess the counter number and direct the data extraction from the appropriately numbered (or named) column, but my excel expertise ends there.

    Can anyone help?

    Ben

  2. #2
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,933

    Re: determining which of 12 columns to draw data from based upon a single variable

    Hi and welcome to the forum

    Sounds to me like this is a job for...superman!!! oops I mean you can use INDIRECT() for this, but to be more specific, I will need to see a sample of what you are working with?
    Attach a sample workbook. Make sure there is just enough data to make it clear what is needed. Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show the process you're trying to complete or automate. Make sure your desired results are demonstrated, mock them up manually if needed. Remember to desensitize the data.

    Click on GO ADVANCED and use the paperclip icon to open the upload window.

    View Pic
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Sorting data into multiple columns based on a single column
    By J.McQ in forum Excel General
    Replies: 7
    Last Post: 03-16-2013, 11:26 AM
  2. Replies: 0
    Last Post: 10-16-2012, 03:26 PM
  3. [SOLVED] Sorting rows of data based off a single column for a variable number of entries.
    By soxcrates in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 08-28-2012, 12:31 PM
  4. Replies: 4
    Last Post: 01-14-2011, 09:30 PM
  5. Replies: 1
    Last Post: 08-09-2010, 07:37 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1