My previous post seemed to have been unclear so I am posting this again and will try to explain the problem more clearly using screenshots.
https://www.dropbox.com/s/4x8wktbdo7jc21m/excel-screenshot.jpg?dl=0
Now, let me explain the screenshots.
Let's take just one of the raw materials in the table, say Rosin (Column B).
Whenever we buy more rosin, I mention the quanity bought and the date(Column A)
and I have the total quantity of rosin bought at the bottom using the formula "=sum(b80:b91)".
You will also notice that the number of rows at present is 11 i.e. 80 to 91.
But we will still be buying more rosin, even when I have entered the data in these rows. i.e. when I enter the dates and the quantity bought.
The problem is that I'll have to keep inserting more rows in there after every few days.
And if I keep doing that then the column for Rosin(as well as for the other raw materials) will become so long that I'll be scrolling forever.
So, is there a way that I could just enter the amount of rosin bought and the date without having to insert more rows.
Here's a link to the excel sheet that I created - https://www.dropbox.com/s/iod5y7jae6grmyz/brc%20goods%20received%20STOCK11.xlsx?dl=0
If you think MS Excel is not the right tool for this, then please recommend the correct tool for this.
I was learning some python and know some programming basics - just for your information.
P.S. Hope I have been able to explain the problem clearly this time.
I admit that the excel sheet looks very confusing and haphazardly done, but I wanted to start doing the calculations and improve the looks of the sheet later on.
basically, you need to use pivot tables to organize and sum your data.
here is an example sheet done for you to illustrate how it is done in your case.
therefore, you need to put each distinct data type in different sheets. In my example, I have put all of the incoming chemicals into one sheet and created a pivot table for it in another sheet. you need to repeat this for chemicals used in a separate sheet, and create a pivot table in the same/separaate sheet. And finally, in another sheet, you can make a table of total chemicals at present, simply by refering to the data in your pivots tables.
Every time you update your data sheets, come back to its pivot table and click refresh to get the latest and update your data across the table.
you can look up some help across tutorial sites on how to create a pivot table, here is one from microsoft
the best solution here would be not to keep multiple tables which you plan to extend on the same sheet, i looked at your file and it is way too confusing and clogged up, separate all the datasets you have into separate sheets, give good descriptive names to these sheets. I noticed you use total rows below each dataset, what you can do(as long as you are in Excel 2007+), create the dataset and then format it as a table from the menu, which makes your data a lot easier to read and handle, it also gives you the option of total row, more to read up on these tables you can here: Format an Excel table
Related
new to this but i need some help with PowerPivot. I have recently created a PowerPivot to pull through 3 different excel documents that will be updated automatically each week with new data. They all have at least 2 of the same unique codes to be able to link them together.
I have managed to link all the files together and create a pivot to show the relevant information from each file under one pivot. my problem is now I need to add some formulas that relate to the actual data in the pivot.
Q1:I need the average of the last 4 weeks of data from the pivot but i need the formula to be able to shift when the new weeks are added.(if there is a way to do this with a dax formula that would be very good as well.
I have dates and weeks in the data set.
Basically I'm after knowing if I am able to create formula next to my pivot that will shift the the data grows or changes.
currently the pivot looks like the picture attached.
I have also attached a pic of the data
Q2:How do i get the pivot to only show me the last 4 weeks nothing else
if anyone has any suggestions on how I could get any of this to work that would be amazing.
Thank in advance power pivot datapivot table
Q1: what i have tried -I have tired to add formula next to the pivot but it breaks or gets deleted when the the pivot updates
Q2: I have created a slicer and I manually change it
If you have a table in excel all column headers are forced to be formatted as general text. I am trying to use a pivot table to reference the data in the table AND see the column headers as dates the only way to do this is to have a completely separate row somewhere else on the spreadsheet that's not part of the table but mirrors the columns with the exception of it being formatted as a date. Thus is my problem, I need to combine these two ranges to make a single range I can use as a value in the pivot table range.
OFFSET($B$11,0,0,ROWS(tblOther[#Data]),COLUMNS(tblOther[#Data]-2))
and
OFFSET(tblOther[#Data],0,0,ROWS(tblOther[#Data]),COLUMNS(tblOther[#Data]-2))
Thanks
Again, all I can do is point you to two great ways I suggested you can mash multiple tables together at your other thread at Combine Multiple Tables Rows Into Master Table
One using PowerQuery, as Ralph suggests
One using VBA.
Now I know at that other thread that you didn't want a PQ or VBA solution, but neither of them is that hard, and I've given you a link to a previous answer with step-by-step pictures that shows how easy PQ is, and a generic VBA routine that is pretty simple to implement.
If you want easy ways to mash tables together, then they are pretty much it. If there's some reason you can't use one or both of those, post back and let me know what the reason is and I'll see if I can help you overcome it.
I'm having a little bit of trouble grouping dates in excel. I have created a pivot table that groups a bunch of dates between 3 months together. However, I want to take advantage of the refresh ability of pivot tables--the idea in which when you refresh your pivot table, it will update to whatever you added or took away from the source of data your pivot table is based on.
However, when I grouped the dates between three months together, I noticed if I don't add a date that exactly corresponds to the dates within the grouping, the picot table does not add that entry into the pivot table. For example, if my grouping had the following dates (between May and July) in it:
5/21/2013, 7/18/2013, 6/8/2013
And in my source data spreadsheet had the following date added to it:
5/2/2013
5/2/2013 would not be added to that specific grouping in the pivot table because it is not exactly like the other dates as stated above. I want it so that I can group all dates from 5/1/2013 to 7/31/2013 inclusively as opposed to the dates in the original grouping. Would anyone have an idea on how to do so? Thanks!
http://www.datawright.com.au/excel_resources/expanding_pivot_tables.htm
im curious as to how you are currently grouping them without adding new ones, there may be a way to work with what you already have especially if you are willing to incorporate some VBA
Provided your source 'dates' are not text Excel should be able to cope.
I fear (hope?) we were at cross-purposes about which "Group" to use. I meant the one that pops up (as on the left below) when right-clicking one of the Qtr headings in the PivotTable.
If you have access to add additional formulas in the data you could just calculate "quarter" in an additional column (reference here)
How can I obtain the year quarter from a date?
I tend to always make my groups in the rows of data like this, rather than attempt it using pivot groups. For example, you might also extract "year" with = year(A1) in the rows - so you can easily add it as a pivot row item later for grouping. If your data source is properly formatted as an excel 2007 "table" these kind of formulas will fill themselves downward when you paste new data.
Thanks guys! I think I may have explained my problem a bit vague. I'm attaching two print screens in order to illustrate my problem.
Print screens: http://imageshack.us/photo/my-images/804/illustrasjon.jpg
My pivot table shows stops [minutes] due to specified reasons on a production line. The 'Totalt' column of the week (in which the number of production days vary) is what I wish to focus on in order to allocate improvement efforts to the right place. The sorting will be performed on a daily basis by others than me, and they really should have a button to press rather than sorting via the options bar.
NB! The 'Sum' column is not part of the pivot table. That's just a calculation of the 'Totalt' column to a fixed column in order to make a sector chart of the sorted result, since it's not possible to make a pivot chart from the 'Totalt' column.
The 'Mål per dag' column is just the daily (minutes) goal within which I wish to keep the production stops of a specified reason, so this should be kept out of the 'Totalt' column, but this is less important.
I have a pivot table filtered by weeks showing any number of days from one to five. The total column to the right that sums up the values of the days are therefore "moving", and this is why I cannot simply record a macro. I want to create a macro that sort the pivot table descending by the total column.
I do not speak the international language of VBA, but imagine that this is fairly easy for someone who does.
Immensely grateful to anyone willing to write the code for me!
Best regards,
Hans
Hans
To start, you should use the built in sort feature on the pivot table as illustrated in the screenshots below.
Select the column you wish to sort by:
This might be a little problematic for you because the pivot table doesn't automatically refresh when your data changes. If you want it to update in real time, then you will want to add the "Worksheet_Change" event handler to the VBA code. To do this, hit Alt+F11 to bring up VBA, and on the worksheet containing your source data enter the following:
Private Sub Worksheet_Change(ByVal Target As Range)
Application.EnableEvents = False
PivotTables("PivotTable1").RefreshTable
Application.EnableEvents = True
End Sub
Here "PivotTable1" will change to match whatever the name of your pivot table is. This name appears in the Ribbon when you have the pivot table selected.
Now, as you change your data, the table will automatically re-sort as you go.
Hans, welcome to SO. You did not specify which version of Excel in your tags, but here are some Excel 2007 solutions.
It is possible (and helpful!) to do this without VBA. You may be interested in this Microsoft solution.
I would recommend that you select the range of the pivot table with the totals, exclude the header and the grand total, and then go to the Data tab and choose the Sort Z->A. This will sort the totals in descending order (and of course, change the headers to the left).
You can also record a macro to do this if you would like to perform this sort on a regular basis, but that may be more trouble than it is worth.
I am attempting to make some reports in Excel using a pivot table of a Sql server view. One of the customer requirements is to be able to filter the reports based on a date range they select, which seems reasonable. The end user process needs to be fairly simple, so my preference is to have a cell for begin date and one for end date and allow the user to
enter these and refresh the table.
There are two problems which I haven't been able to get past:
Selecting a date filter doesn't appear to provide any way for me to reference a cell as a source for the value. I have to put it in at the time.
It seems as if it is only possible to define a date range if I am grouping on the date field. For some of the reports, this violates the specification. The Report Filter section of a pivot table only seems to allow me to filter by individual values rather than a range. This gets unmanageable on real data which might have hundreds of dates to go through.
One thing I have tried is to create an intermediate table without any aggregates columns in a separate sheet in the same workbook, and then filter that. This hid the columns correctly in that intermediate table, but had no effect on the pivot table which derived from it.
Does anyone have ideas for how I can make this work? It seems like a fairly obvious use case - is there something I am missing about how pivot tables are supposed to be used?
The easies thing you can do is changing your pivot table query on the fly.
When the source cell is changed (Worksheet_Changed event), append " AND WhateverDate > '1/1/1111'" to Me.PivotTables("Your pivot").PivotCache.CommandText and refresh the pivot.
I remember I solved a similar requirement some years ago by making the SQL query dynamic (i. e. putting it together as a string in VBA, and using the cells with the range values in the where condition). ant the VBA macor was then called with a button labeled "refresh".
But I am sorry do not have this code available any more, I just remember the general idea.
This has been dead for a while, but I thought I would post a different method. add a formula to the source table that returns a '1' for thing you want, and a '0' for things you don't, and then add a filter in the pivot table that filters only the '1'.