Split data in a column to multiple rows - excel

I have an excel sheet where column A contains month and column B contains sales. 1 month can have multiple rows with different sales. I need to sum up the sales in every month. And then output in a new worksheet titled "Report" with each row for a new month.
I could have:
Month Sales
Jan 15
Jan 5
Feb 3
Mar 4
Mar 8
I need to produce this:
Month Sales
Jan 20
Feb 3
Mar 12

Try using a pivot a table. Select the data range, go to Insert tab then press Pivot Table and OK (it will put the Pivot table into a new sheet by default).
Put Month into Rows box and Sales into Values box.

Have in mind that data appears in Column A (Month) & Column B (Sales). Range A2:B6.
Steps:
Select D2
Go Data - Data Tools tab - Consollidate
Reference: $A$2:$B$6
Press Add and ensure that the reference appears in All references box
Use labels in: Left Column
Press OK
Results:

Related

How to Display months based on the Quarter Selection

I have 2 columns in Excel sheet, Column1 has the Quarter Selection dropdown box(Q1, Q2, Q3 and Q4). And Column2 has the month selction dropdown box.
I need help in the below.
Q1 - Feb, March, April
Q2 - May, Jun, July
Q3 - Aug, Sep, Oct
Q4 - Nov, Dec, Jan
Now if a user selects Quarter as Q2 in Column1, the Dropdown values in Column2 has to have only May, June and July.
I tried the grouping option but it doesn't help me.
Thanks in Advance,
Satish D
You should create two tables, one containing quarters, and other containing all quarters with corresponding months (tables are surrounded with thick border).
Then in cell A2 create simple data validation and set list in D1:D4 as source.
In cell B1 also create data validation list, set allow to list, and in formula area please enter this formula =OFFSET(INDIRECT(ADDRESS(MATCH($A$1,E1:E12,0),5)),0,1,3,1)
You data validation list in cell B1 is now dependent on selection in list A1.

How to find number of matching values with an ID?

I have a unique list of IDs of people on two separate sheets. One for initial 'registration data' which is the master data list. In column A is the ID, column B is their town of residence and column C is the date in which the person was added to the list.
I send out sheets to the different towns every month to receive some more data about the new people added to the list, and every month (the same month) they should send it back to me. This received data goes onto a second sheet, with again: column A for person, B for town, and C for month data received.
I need to check how accurate the towns are in getting the data back to me on time. So I need to count the number of forms on the second sheet where the month is the same as the initial month on sheet number one, and the towns match too.
I have tried COUNTIFS with VLOOKUPs but am having no luck. I want to avoid having to make an interim data table as much as possible because I need the process to be slick and automatic.
Could this be done with a SUMPRODUCT?
For example:
Sheet 1 (initial) Sheet 2 (received)
123, TownA, Feb 123, TownA, Feb
124, TownB, Feb 124, TownB, Mar
127, TownB, Mar 127, TownB, Mar
130, TownC, Mar 130, TownC, Mar
220, TownC, Apr (we didn't receive back 220)
OUTPUT SHEET
Feb Mar Apr
TownA 1 0 0
TownB 0 1 0
TownC 0 1 0
As you can see, of the five forms we only received three in the month we were supposed to. I want it in the view above, and don't really want to have to make a new sheet with the IDs to match the months up.
In Sheet3 with Feb in C1, Mar in D1 and Apr in E1 and 123 etc in A2 etc, in B2:
=VLOOKUP(A2,Sheet1!A:B,2,0)
in C2:
=(INDEX(Sheet1!$C:$C,MATCH($A2,Sheet1!$A:$A))=C$1)*(INDEX(Sheet2!$C:$C,MATCH($A2,Sheet2!$A:$A))=C$1)
C2 copied across to E2 and B2:E2 copied down to suit.
Then select A:E and DATA > Subtotal At each change in: (ColumnB), Use function: Sum, Add subtotal to: check Feb, Mar, Apr, Summary below data and OK.
Copy A:E, Paste Special, Values over the top and apply filter. Filter ColumnB, Text Filters, Custom Filter..., contains Tot, OK.
In the first populated cell in ColumnB enter =Bn (where n is the row number immediately above that cell, though not visible) and copy down to suit.
Hide or delete the totals row to suit.

Create UI to filter and aggregate in Excel

I have a long excel containing dates and many value columns. I would want to create a dynamic filter where the user can input a date range in two cells and the values from each column will be filtered by the date range and an aggregated value calculated from the filtered values will be shown.
For example in the table:
Row year weight_pounds gestation_weeks
1 2005 6.0627122049999995 38
2 2006 7.12534030784 40
3 2007 7.4406013425 39
4 2008 3.30032006214 43
5 2009 7.1099079495 41
6 2010 7.31273323054 40
7 2010 9.31232594688 42
I want to filter by year 2007 to 2009 and show the average on both value columns in the sheet.
How can I approach this in excel? I have no experience to VBA but I am open to VBA if it is required.
Define a helper column that tests whether the row is within the required date range and filter based on that column.
Suppose the start date is in X1 and end date is in X2. And suppose your main data table starts with the heading Row in A1.
Then the formula in D2 might be something like =and(B2>=X1,B2<=X2)
Copy that formula down the whole list to give a column with TRUE and FALSE values
Turn on filters on the heading row
Select just TRUE in the helper column
For the average you can either use =SUBTOTAL(101,C:C) (the 101 parameter says to give the average of the rows that are still visible) or =AVERAGEIFS(C:C,B:B,">="&X1,B:B,"<="&X2) (which works regardless of how the main data table has been filtered.

Sorting multiple columns based on product name in Excel

I have a question about sorting multiple columns based on name. I know this is a job for vlookup or index match based on my Google results, but I am having trouble creating my solution. I am creating a worksheet that will have two columns for everyday of the month.
So the column names across will be: Product, Sales, BLANK, Product, Sales, etc) Some of the columns have more products and I want all the columns to have the same order.
So for example if the prduct was it Column A, but not column D, there would be a blank row in D to indicate this.
Can someone walk me through creating this formula?
If you have an option of keeping the data in table format (example below), then Pivot table will be an easy solution.
Data (wouldn't have bullets but I couldn't format it differently here):
Date Product Sales
Jan 1 prod1 $1,235.00
Jan 1 prod2 $5,104.00
Jan 1 prod3 $21.00
Jan 2 prod1 $254.00
Select all your data, then in the Menu bar click on Insert -> Pivot Table -> Ok. Choose date for your Column Headers, Product for your Row Headers and Sales for Values. Hope this helps!

How to Filter out Duplicate rows(By a specific column) in Excel or Open Office CALC ??

I want to filter out rows in Excel/Open Office CALC like this :
Here is My Table Structure
Emp_No and Note Added are the column names
Emp_no. Note added
10 salary due by 13th Oct
10 salary pending
10 salary paid
10 salary not paid
23 salary paid
23 salary not paid for 2 months
23 salary due this month
Now, I want to keep only the first ROW from the set of rows containing Emp_No as 10 and keep only first ROW from the next set of values containing Emp_No value as 23.
So in short, I want a output like this :
Emp_no. Note added
10 salary due by 13th Oct
23 salary paid
Kindly help !!
With a helper column this formula:
=IF(B1=B2,"",B2)
in Row2 and copied down should pick out the first instance (each change) in Emp_no., if that is in ColumnB.
Filtering to select (Blanks) in the column with these formulae should then pick out all the rows where the Emp_no. is the same as the row immediately above - at which point they may be deleted to achieve the result shown as required from the data sample provided.

Resources