+ Reply to Thread
Results 1 to 5 of 5

Return record from a datasheet and start again at top of the list - data transposition

  1. #1
    Registered User
    Join Date
    05-22-2012
    Location
    UK
    MS-Off Ver
    Excel 2007
    Posts
    3

    Return record from a datasheet and start again at top of the list - data transposition

    Dear All,

    I enclose an Excel workbook. The first sheet "data" has the source data. In the second sheet "output", I need to show the same data, but in a certain format. The "output" format has to be a Period number in ascending order for each transaction, with the corresponding sales person and region against each unique period number.

    In the "output" sheet, I have written a formula that lists the number of periods for each transaction, and is limited by the number of rows/records from the "data" sheet (here it is 6 rows/records). So, period 1 has 6 records, period 2 has 6 records and so on until period 12.

    What I am unable to write as a formula is that each time a period number changes, the formula would start referencing the first record in the list for sales person and region. In the "output" sheet i have manually typed what records i'd expect to see the formula return for sales person and region.

    Additionally, I cannot use a Pivot table to summarise the data.

    Please can any one help solve this problem?

    Regards,

    David
    Attached Files Attached Files

  2. #2
    Forum Expert CK76's Avatar
    Join Date
    06-16-2015
    Location
    ONT, Canada
    MS-Off Ver
    MS365 Apps for enterprise
    Posts
    5,935

    Re: Return record from a datasheet and start again at top of the list - data transposition

    For sales person...
    =INDEX(data!$A$2:$A$7,COUNTIF(A$2:A2,A2))

    Copy down.

    For Region...
    =INDEX(data!$B$2:$B$7,MATCH(B2,data!$A$2:$A$7,0))
    Copy Down.

    See attached.
    Attached Files Attached Files
    ?Progress isn't made by early risers. It's made by lazy men trying to find easier ways to do something.?
    ― Robert A. Heinlein

  3. #3
    Registered User
    Join Date
    05-22-2012
    Location
    UK
    MS-Off Ver
    Excel 2007
    Posts
    3

    Re: Return record from a datasheet and start again at top of the list - data transposition

    Dear CK76,

    Apologies for the delay in my response, I have been unable to access the site until now. Thank you for your help with this matter. The formula worked perfectly.

    As an added complication, John W now also has responsibility for East region, as well as North. The current formula would only return North (as the INDEX is looking for the Name John W, and I assume it returns the first record against John W's name). Is it therefore possible for a formula to find the position of John W and East (perhaps using ROWS?), rather than using the name John W as a look up?

    I attach the Excel file, and I've highlighted in red text where John W should return East, rather then North, based on the updated data.

    Many thanks,

    David
    Attached Files Attached Files
    Last edited by Davo103; 08-30-2017 at 06:40 AM. Reason: missing upload file

  4. #4
    Forum Expert CK76's Avatar
    Join Date
    06-16-2015
    Location
    ONT, Canada
    MS-Off Ver
    MS365 Apps for enterprise
    Posts
    5,935

    Re: Return record from a datasheet and start again at top of the list - data transposition

    If the structure does not change...

    You can just use the 1st formula with adjusted range.
    In C2.
    =INDEX(data!$B$2:$B$8,COUNTIF(A$2:A2,A2))

    Copy down.

  5. #5
    Registered User
    Join Date
    05-22-2012
    Location
    UK
    MS-Off Ver
    Excel 2007
    Posts
    3

    Re: Return record from a datasheet and start again at top of the list - data transposition

    Many thanks CK76. You have been very helpful! Kind regards.

+ 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] Return value even if row contains no data in first record
    By Aquarock in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 02-19-2016, 01:41 PM
  2. Replies: 2
    Last Post: 10-06-2015, 01:19 AM
  3. Transposition of items from one list to another
    By sergey.fomin in forum Excel General
    Replies: 5
    Last Post: 06-30-2014, 12:11 PM
  4. VBA for display Various Datasheet data in Masterdatasheet when we choose datasheet name
    By santosh226001 in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 02-08-2014, 10:21 AM
  5. Replies: 14
    Last Post: 10-07-2013, 04:04 PM
  6. Return data to datasheet when checkbox in the form is checked
    By Apple Ling in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-14-2013, 02:09 AM
  7. Replies: 1
    Last Post: 02-17-2012, 05:10 AM

Tags for this Thread

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