Reformatting table

%3CLINGO-SUB%20id%3D%22lingo-sub-2975309%22%20slang%3D%22en-US%22%3EReformatting%20table%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2975309%22%20slang%3D%22en-US%22%3E%3CP%3EHi%20everyone%2C%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20have%20a%20sheet%20in%20excel%20where%20i%20have%20counts%20for%20certain%20drugs%2C%20and%20each%20column%20corresponds%20to%20a%20specific%20state.%26nbsp%3B%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22aiyer1217_0-1637158924738.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F327607iABD6A8A6653830DF%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22aiyer1217_0-1637158924738.png%22%20alt%3D%22aiyer1217_0-1637158924738.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EHowever%2C%20I%20would%20like%20to%20reformat%20this%20so%20that%20there%20is%20a%20single%20column%20in%20which%20the%20states%20are%20listed%2C%20as%20shown%20below%3A%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22aiyer1217_1-1637159042608.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F327608i44B53CBB74FAF072%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22aiyer1217_1-1637159042608.png%22%20alt%3D%22aiyer1217_1-1637159042608.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20have%20done%20this%20with%20one%20of%20my%20datasets%20by%20manually%20copying%20and%20pasting%20the%20numbers%20for%20each%20state%20into%20column%20C%2C%20and%20then%20copying%20and%20pasting%20the%20state%20name%20into%20column%20B%2C%20as%20shown%20here.%26nbsp%3B%20%26nbsp%3BHowever%2C%20I%20have%20to%20do%20this%20with%20multiple%20datasets%20and%20it%20will%20take%20quite%20a%20bit%20of%20time!%26nbsp%3B%20Any%20insight%20on%20potential%20shortcuts%20I%20can%20take%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThanks!%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-2975309%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EExcel%20for%20web%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2975382%22%20slang%3D%22en-US%22%3ERe%3A%20Reformatting%20table%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2975382%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F1221550%22%20target%3D%22_blank%22%3E%40aiyer1217%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EThat%20could%20be%20done%20with%20Power%20Query%20if%20you%20have%20Excel%20for%20Windows%20desktop%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2975448%22%20slang%3D%22en-US%22%3ERe%3A%20Reformatting%20table%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2975448%22%20slang%3D%22en-US%22%3EThank%20you!%20Would%20you%20mind%20briefly%20walking%20through%20the%20steps%20on%20how%20to%20do%20this%3F%3C%2FLINGO-BODY%3E
New Contributor

Hi everyone,

 

I have a sheet in excel where i have counts for certain drugs, and each column corresponds to a specific state.  

aiyer1217_0-1637158924738.png

 

However, I would like to reformat this so that there is a single column in which the states are listed, as shown below:

 

aiyer1217_1-1637159042608.png

 

 

I have done this with one of my datasets by manually copying and pasting the numbers for each state into column C, and then copying and pasting the state name into column B, as shown here.   However, I have to do this with multiple datasets and it will take quite a bit of time!  Any insight on potential shortcuts I can take?

 

Thanks!

 

3 Replies

@aiyer1217 

That could be done with Power Query if you have Excel for Windows desktop

Thank you! Would you mind briefly walking through the steps on how to do this?

@aiyer1217 

Let assume source data as

image.png

Power Query this table, select column B and Unpivot other columns. Practically that's all, result is as

image.png

if only to play with formatting more.