+ Reply to Thread
Results 1 to 5 of 5

Transform using a formula

  1. #1
    Registered User
    Join Date
    05-16-2018
    Location
    Norwich, England
    MS-Off Ver
    Office 365
    Posts
    3

    Transform using a formula

    Hi all. I've been struggling with this a while. Running around in circles now. Effectively I have flat data populated by a data entry system. So the source has rows added or deleted over time. It is a people record and in particular, it records which programmes a person is allocate too. Each Portfolio and Progamme is related. So in the attached example, a Portfolio 1 entry would relate to Programme 1 entry. Portfolio 2, to Programme 2, and Portfolio 3 to Programme 3. So effectively a person can be on up to three assignments. I need to report these assignments but at the Portfolio and Programme level. I've tried pivoting on it, INDEX and MATCH etc. I confess to coming up to my knowledge level on this...

    In the example, I effectively want to transform the rows into columns so I can collate the data into something like this, which I can then sort by Portfolio etc.

    Portfolio Programme Last Name
    Portfolio A Programme A Jones
    Portfolio A Programme B Jones
    Portfolio T Programme D Jones
    Portfolio A Programme B Wilson
    Portfolio C Programme C Doe
    Portfolio B Programme B Doe
    Portfolio B Programme E Franklin
    Portfolio T Programme T Pepper
    Portfolio A Programme C Stevens
    Portfolio B Programme B Stevens
    Portfolio S Programme G Perez
    Portfolio A Programme A Smith
    Portfolio B Programme B Smith
    Attached Files Attached Files

  2. #2
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    25,426

    Re: Transform using a formula

    Put this formula in S2:

    =COUNTA(P2:R2)

    It should automatically copy down, and gives a count of the number of records that each row of your table should generate. Then you can put zero in cell U1 (important), and this formula in U2:

    =S2+U1

    Copy this down to U9, as it is outside the extent of your table, and this will give a cumulative count of the number of records.

    Then you can use these formulae in the cells stated:

    A15: =IFERROR(INDEX(M:O,MATCH(ROWS($1:1)-1,U:U)+1,ROWS($1:1)-INDEX(U:U,MATCH(ROWS($1:1)-1,U:U))),"")

    B15: =IFERROR(INDEX(P:S,MATCH(ROWS($1:1)-1,U:U)+1,ROWS($1:1)-INDEX(U:U,MATCH(ROWS($1:1)-1,U:U))),"")

    C15: =IFERROR(INDEX(B:B,MATCH(ROWS($1:1)-1,U:U)+1),"")

    Copy these 3 formulae down as far as you need to (until you start to get blanks, although the number at the bottom of column U tells you how many rows you will need).

    Hope this helps.

    Pete

  3. #3
    Registered User
    Join Date
    05-16-2018
    Location
    Norwich, England
    MS-Off Ver
    Office 365
    Posts
    3

    Re: Transform using a formula

    Wow. A thing of beauty! Works perfectly. I was close but would never have thought of the order of the indexing and matching! I've managed to extend it to encompass many other fields in my real sheet and avoid the dreaded COUNTA that includes blank cells with formulas! You sir, are a gentlemen! Many thanks. Very elegant for what I needed. Cheers, Tony.

  4. #4
    Forum Contributor
    Join Date
    03-18-2014
    Location
    Singapore
    MS-Off Ver
    Excel 2016 / 2019
    Posts
    251

    Re: Transform using a formula

    Hi

    Use Power Query (since you are using office 365), it is simple and build once and you can just right click refresh result

    You can try adding new rows and see the result (by refreshing)
    Attached Files Attached Files
    Christopher Yap

  5. #5
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    25,426

    Re: Transform using a formula

    Glad to help - thanks for the rep.

    If that takes care of your original question, please take a moment to select Thread Tools from the menu above and to the right of your first post in this thread, and mark the thread as SOLVED.

    Pete

+ 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. Formula for transform data horizontal.
    By inform in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 10-09-2017, 02:53 PM
  2. transform into do until formula
    By ammartino44 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-25-2015, 04:41 PM
  3. [SOLVED] transform cells with visible values (formula to value)
    By a.hudrea in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-11-2014, 03:39 AM
  4. [SOLVED] transform formula for excel 2000
    By max_max in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-28-2013, 10:07 AM
  5. How to make a formula transform a value in words
    By nantunes69 in forum Excel General
    Replies: 3
    Last Post: 05-09-2013, 09:23 AM
  6. Transform If Code to Formula
    By fron in forum Excel General
    Replies: 3
    Last Post: 04-23-2007, 10:49 PM
  7. Transform a Cell from Formula to Number
    By Sloth in forum Excel General
    Replies: 4
    Last Post: 07-11-2005, 01:05 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