rotating columns into rows with excel - excel

I have an excel sheet that looks like this:
dont ask me how this happened, but somehow things that should be columns are in this sheet as rows...
you can see the repeating Account numbers and the words in column c, imagine everything rotated 180 degrees. And insert blanks or nulls for the field that doesnt exist for that specific Account number.
In short it should end up looking like this:
I cant think of an easy way to do this inside of excel. But perhaps with some VBA code?
what would be the easiest solution? and how do I implement it?
I know this question isnt very clear, but if you leave some directing comments, I would be happy to edit this question till it makes sense. Thanks!

You don't need VBA for this :)
I am taking a selective example to show how you can proceed.
Let's say your data looks like this
Now, create a Pivot of your data. This will give you unique Account numbers. See the screenshot below.
Then create a table with the respective headers as shown in your screenshot and copy and paste the unique Account Number from your pivot there.
Now you are ready to pull up your data. So as per the above screenshots enter this formula in cell B13. Note this is an Array formula. You have to press CTL + SHIFT + ENTER
=INDEX($D$2:$D$5,MATCH(1,($C$2:$C$5=B12)*($A$2:$A$5=A13),0))
Simply do that for the rest :)

Related

Excel: Find and select multiple cells

I am an excel noob with a massive and weirdly organized spreadsheet that contains several columns with hundreds of account number values.
I have identified 70 of these accounts that are "special" based on criteria not in this spreadsheet. I wish to select EVERY cell containing one of the 70 identified account ID's but I cant figure out how to do this. The Excel search function doesn't have any OR operator.
Is there a simple way to do this? If not can someone please be really specific when describing the hard way to do it? I'm sure this can be done somehow.
Thank you so much!
And in addition to Tim’s question: do you have the 70 accounts in a table somewhere? If so, you might be able to use VLOOKUP.
Well you can just press Shift and click on every cell you want to selec withaut stopping pressing it.

Add cell values having particular text

First, I know that DSUM and SUMIF works with the values in the entire cell. I would like to know if I can add values of cells where part of the string contains a particular text.
Let me explain. I use Google Sheets to manage my expenses, and gather data about my financials. I have something like this—
As you can see, above is a typical example of a day. Each cell has a category, and a description, and below it, the value in the next row. Now is it possible to add values of the cell containing the word "TAXIS"? This way I should be able to get a sum of expenses for a particular category.
I've tried a vast number of expense managers, but none that I am happy with. Finally have decided to go the manual route, and here I am. Any help would be appreciated. Thanks in advance!
You can use wild card to add part of string. Suppose you data starts from C2 cell and data goes like your screenshot then you can use following formula.
=SUMIF(C2:K2,"*TAXIS*",C3:K3)
Obviously you have to customize formula based on your sheet from where data starts and ends.

Transpose 2 columns into 8 columns (consolidating the data from column 1)

I have a spreadsheet of tons of data; about 370,000 rows in my first export. However, it looks like "A" in the screenshot link below. I need a quick way to format this data to look like "B" in the screenshot link below. Does anyone have a trick to do this?
excel_example_screenshot
I've been able to do it manually, but with so much data (and the fact that I will be exporting many more of this same type of data), it's going to take way too much time. The steps I take to do this manually are:
Filter the data to show only 0 from column A
Copy the entire column B range
Paste into a new sheet under the first column
Repeat steps 1-3 for numbers 1-7 from column A
This is how I made the screenshot.
EDIT: Someone marked this as duplicate. Please re-read the way the other ticket is displaying the data. It is in no way the same as what I need other than splitting into multiple columns. I need the data to remain linked to the "0-7" numbers I have on the left side. It can't simply be split for printing purposes. The end result will eventually be a chart.
Here's what my data looks like with the answer from the linked ticket:
failed_transpose_example
EDIT2: I guess it's not completely obvious from my explanation, but I know little to nothing about Excel functions/statements.
EDIT3: #ScottCraner's answer in the comments did what I needed. Different than the answer in the linked ticket.

(excel) sumproduct multiplying with another sheet

i have a little problem with final formulas in one of my column. How to start. maybe i will explain what i have a then what i want.
i have an excel worksheet with 3 sheets. i want to record goods and what are these goods made of. first is sheet called Goods where is possible to put number of goods i want to make. In this case i want to make 1x sandwich1 and at the same time 3x sandwich2. i dont want make sandwich3 this time.
Second sheet is Matrix sheet where I record every good and what it is made of. This sheet is basic sheet and all other sheets take list of goods (resp. ingredients) from this sheet. Simply when i want to make sandwich1 i look at matrix and know that i need 1x1pc of egg + 1x5g of cheese. And for 3x sandwiche2 i need 3x10g of sausages.
Final sheet is called Ingredients. It is a list of used ingredients from Matrix sheet (exactly same order) to make these sandwiches. I want to fill formulas into column B which would go through one ingredient ofter ingredient and count needed amount of it. So it would look into matrix in the same row and where there is some number it would multiply with number of items from Goods sheet. The list of goods is also in the same order as in the matrix sheet.
I hope you understand now what i want and will try to help me. I think there will be SUMPRODUCT, SUMIF and maybe INDERECT functions but i am not that skilled in excel
thanks for any suggestions
You can use MMULT function here - it's an "array formula" which you need to enter in a range. You can do that like this:
In Ingredients worksheet enter this formula in B2
=MMULT(Matrix!C2:E4+0;Goods!B2:B4+0)
[I'm assuming you have a European version of Excel where ; is used to separate arguments]
Now select the whole range B2:B4, press F2 key to select formula and hold down CTRL and SHIFT keys and press ENTER. This "array enters" the formula in the range and you should now see curly braces like { and } around the formula and also the correct results.
You cannot change part of that array now, only the whole thing
Note that I'm assuming that the contents of Goods!A2:A4 will be the same as Matrix!C1:E1 and in the same order. You can extend the ranges to be as large as you like as long as that principle still holds
I suspect that this is an issue of "when all you have is a hammer, every problem is a nail". For reasons known only to you you are using a spreadsheet to solve a problem that databases were made to do. Any solution to this problem in a spreadsheet will be entirely dependent on the integrity of your data - add another column or get things out of order and it will fail.
That said, what you have in your link is effectively a pivot table and what you need is the unpivoted version of this - the instructions for getting this are here.
When you have that, you can use the various database functions in excel to get your answer.

working with HUGE spreadsheet

i have about 300,000 records in this spreadsheet. and there are a couple hundred columns!!
one of the columns is the social security number and i need to replace it with some random identifier. i cant really do a vlookup because that is too taxing so i think i am going to write a macro
can anyone please suggest to me how do i do this?
please note that the social security numbers appear multiplle times. so i need them to map correctly to the new unique identifier
Create a hash based on the current SSN.
An example is here using SHA1 hash. Plenty of other options exist, including creating your own.
Why not simply enter a Random number in the column in question, like =RAND(), double-click the bottom corner of the cell to copy the formula to the bottom of your sheet, then copy/paste special value the column on itself to get rid of the formula?

Resources