Forum Discussion

Mellisa1260's avatar
Mellisa1260
Copper Contributor
Sep 16, 2021

Formula to transpose one column into two

Hello there
I’m not sure what the best formula is to transpose where for example I have one column for two categories combined . For example food category and food needs to be split into two, a vlookup mapping won’t work as there are duplicate categories . I want it to be able to look like column D&E? Any suggestions ?

4 Replies

  • Riny_van_Eekelen's avatar
    Riny_van_Eekelen
    Platinum Contributor

    Mellisa1260 With PowerQuery (PQ) this would be a piece of cake, using "Fill Up", once you have established which of the words in column A represent Foods and which are the Categories. PowerQuery is only available for the Windows version of Excel. I'm on a Mac right now and, thus, can't demonstrate it. But if you don't mind to add some helper columns, you can fairly easily achieve the outcome you described without PQ.

     

    First, I'm matching the "words" in column A with a list of known Categories (column B), based on a lookup table. Then, I count how many rows in column B, from the first row to the current row, contain a value not equal to zero (column C) and add 1. That gives the index for the Category name in the lookup table. You may hide columns B and C and filter out the blanks from column D to be left with a table of Foods and the Category they belong to.

     

     

  • NikolinoDE's avatar
    NikolinoDE
    Platinum Contributor
    A and E columns are the same, unfortunately I do not understand what exactly you want to accomplish.

    Something more detailed would help, even for those who have to do a translation in advance.

    Thank you for your understanding and patience

    NikolinoDE

Resources