Count the number of orders in the order table - excel

I just needs some help on a formula to count the numbers of orders in the orders table for each customer.
Table Name = "Orders"
See the image:
So in another worksheet, the formula counts the orders for each individual customer.
I countn't get the countif to work as each amount of orders vary between customers. The PivotTable didn't work either as there are blank spaces in the customer numbers.
Any other solutions to my problem?

Quick way to fill the blank cells:
Select the cells from A5:C5 and all the way down the table
Hit F5
Click Special
Tick "Blanks" and hit OK
All blank cells in the range are now selected. Without changing the selection,
type a = sign
hit the up arrow key on your keyboard.
Hold down Ctrl and hit Enter
Now all previously blank cells contain a formula that references the cell right above. Copy the columns and paste them over themselves with Paste Special > Values to replace the formulas with the values.
Now you can build a pivot table for the count.
As an alternative to filling in the blank cells you could use a helper column with a formula along the lines of
=IF(LEN(B5)=0,H4,B5)
Start the formula in cell H5 and copy down. Now you can use a pivot table with this helper column. You can hide the helper column if it upsets your spreadsheet design.

Related

Select a Large Number of Individual Cells in Excel

In addition to a single cell, Excel allows you to select multiple unconnected cells independently by pressing ctrl when clicking the cells.
I use this feature to insert a row between each existing row, which is my ultimate goal. You can do this by independently selecting one cell in each row and then right-clicking and inserting rows.
This process works fine for tens of rows, but in some cases, I need to independently select 1000+ cells in a column to insert a row between each row in a large sheet. To be clear, I'm not talking about ranges. Instead of A1:A1000, I mean to select A1,A2,A3...A1000.
Is this possible without manually clicking each cell?
Insert a helper column with even numbers this way
type the value 2 into the first row
type the value 4 into the second row
select the two cells and double click the fill handle to fill down to the last row of your data or drag to the desired point.
Below your data, in the same column, enter odd numbers 1,3,5,etc, using a similar technique.
Next, sort your data by the new column.
Viola! Blank rows between all rows of data.

Prevent Excel table from auto-populating rows

If you have an Excel table (listobject) in which all the cells of a column contain the same formula, and you add one or more new rows, the formula will be automatically entered in all the new cells of the column. This is one of my favorite feature of Excel tables.
But my current table has more than one formula in the same column(s). And when I create a new row, it's filling it in with one of those formulas. Not only is it choosing what is usually the wrong formula, but in most cases I need the row to be blank.
Is there a way to turn off the auto-fill of table rows? (Especially if I can restrict it to particular columns.)
If necessary, I can write some VBA code to clear the row as its created, but I'd like to see other options first.
This first time you enter a formula in a table column the AutoCorrect options button should display. Click the button and select Stop Automatically Creating Calculated Columns. This should turn the autofill off for your table.

Structured references vs explicit cell references

I'm using Index-Match to match Full Names with head count in that party.
I have it working but it uses both the structured and explicit cell reference.
I can't figure out why when I add a new row in my table, the column with the index-match formula wont populate the last row.
This is the formula used:
=IFNA(INDEX(AA:AA,MATCH([#[Preferred Seating 1st Choice]],D:D,0)),"")
Column AA has the head count number and column D has the list of full names.
Preferred Seating is the column used to reference the search.
I looked around and can't seem to find why it wont fill in the last row after that rown info is entered.
I can only assume it has something to do with the mixed Explicit-structured cell/column references. Any help please.
Yes Excel may not automatically assume a formula needs to be automatically filled in an entire table column if it contains unusual references. Unless you have data outside the table, you should just refer to the columns in the table:
=IFNA(INDEX([Column AA Name],MATCH([#[Preferred Seating 1st Choice]],[Column D Name],0)),"")
These can be easily entered when editing the formula by selecting all cells in the source columns excluding the heading. The formula will always use the entire
source columns and the formula should automatically fill its own entire column.
You can also control whether a column automatically has its formula updated through a hidden property. The ability to change the behavior of the column only appears through the front end when you're making changes to the column.
After entering a formula in a column, Excel will either automatically fill the entire column and give you the option to turn off the automatic fill, or Excel will not automatically fill the entire column and give you the option to turn it on.
After entering a formula that isn't being filled, this icon will appear:
Click it and then select to Overwrite all cells in this column with this formula
Deleting a formula from one cell in a column that is being automatically filled will turn off the automatic fill. Double clicking a cell with a formula and pressing enter will give you the option to turn it on again.

Trying to select rows that matched in vlookup excel

I am trying to select the rows of the results from my VLOOKUP and put the results in a neat table in another sheet. The row in my "M" column has a lot of NA and random numbers that were matched.
See this image for clarification:
I want to select all the rows that returned a result and move those rows to another sheet in a table without blank rows between the results. I am not sure how to do this but I know a resident stackoverflow pro probably thinks this is cake. Thanks for the help in advance!
You could make use of a filter:
Select your table and put a filter (under Home tab, Sort & Filter).
Uncheck the #N/A in the selection filter (click the little grey box with black arrow for the column where there are the #N/A that appeared when you inserted the filters).
Copy and paste everything you need into the other sheet.
You can do this with some formulas:
In the column next to your VLOOKUP (I assume it's column C) place a 'counter formula'- in D2, place =IF(ISERROR(C2),0,1), in D3 and below: =IF(ISERROR(C3),D2,D2+1)
Create a new table (say in starting in column F in the same sheet)
In the first column of the table, just place increasing numbers (e.g. in F2: =ROW()-1)
In the next columns, use INDEX/MATCH to retrieve the results, e.g. in G2: =INDEX(A:A,MATCH(F2,D:D,0))
Done!

Excel: Agregate multiple tables separated by title

I have an excel file generated by SAP. I need change its format from multiple tables separated by a title to one single table. This is the original table:
and i need it to look like this:
Im new to excel, so i dont have a clue how to do it.
I cant do it manually becuase the file has 5000+ rows.
Any guidance?
I usually use the generic formula:
=IF(XX="",YY,XX/ZZ)
Where XX is a cell you can use to identify a header to append to the individual transactions and YY is the cell directly above the cell you have put your formula. XX is when you need that value itself, ZZ is another value. You'll understand when you apply it.
For instance, here, you could use cell D5 to do this. I would insert two columns before column D (the value of cell D5 is now in cell F5), and put this formula in cell C5:
=IF(F5="",C4,B5)
I will then fill the formula down. This carries the Material ID everywhere down to the last row. There are two quick ways to do this in a file of this type:
Copy the formula, scroll to the bottom of the sheet, hold Shift and click the last cell in the column, then paste.
Select the cell containing the formula, scroll to the bottom of the sheet, hold Shift and do Ctrl + ,D.
In cell D5, I would put the formula:
=IF(F5="",D4,F5)
And fill it down as well to get the material description.
Now for the size per unit, you can create a column to the right of column K (column K now has 'Size per Unit' since we inserted two columns earlier), and put this formula in cell L6:
=IF(K6="",L5,K6)
Fill it down to get it everywhere.
Now, to finish it up, select the whole sheet and copy/paste values (Paste Special > Paste Values) to remove the formulae. Delete rows 1 and 2, put a filter and sort by a field such as the column 'Metric'. Go to the bottom and delete the no longer needed rows.
As a bonus, if you need to make absolutely sure that the order of the transactions is the same as initially, insert a column somewhere, put sequential numbers into it; that is the first cell in the column has 1, the second 2, then 3 etc and fill to the bottom. Be sure that it is in the filter when you delete the unneeded rows, and sort by this column when you are done.
5000+ rows is still good though, I've had to deal with 10+ workbooks each with ~90000 rows once ;)

Resources