Is there a way to extract data from an adjacent Excel worksheet (Daily) for one month and consolidate it to another worksheet (monthly)? Please see attached sheet. Thanks . If another way works better than Pivot Tables that is fine.
Is there a way to extract data from an adjacent Excel worksheet (Daily) for one month and consolidate it to another worksheet (monthly)? Please see attached sheet. Thanks . If another way works better than Pivot Tables that is fine.
hi there. you have more than 1 year inside. does the year not matter? if it does, then it's better to type like 1Jan2014 in MONTHLY sheet B1. you can always format cells -> Custom:
mmm
what you can do in your DAILY 2 sheet in the pivot is to right-click A4 or any other dates -> Group. you can choose either just Months if Years doesn't matter. if it does, choose Years too. shift Date to the Column Labels and you have what you want in MONTHLY sheet.
if you want formulas in MONTHLY sheet (without years), try this in B2:
=SUMPRODUCT((TEXT(DAILY!$A$2:$A$2923,"mmm")=B1)*DAILY!$B$2:$B$2923)
do take note that B1 has an extra space behind "Jan", so it won't work. get rid of the space
with years (you have to type 1jan2014 like i suggested), try:
=SUMIFS(DAILY!$B:$B,DAILY!$A:$A,">="&B1,DAILY!$A:$A,"<="&EOMONTH(B1,0))
Thanks, if you have clicked on the * and added our rep.
If you're satisfied with the answer, click Thread Tools above your first post, select "Mark your thread as Solved".
"Contentment is not the fulfillment of what you want, but the realization of what you already have."
Tips & Tutorials I Compiled | How to Get Quick & Good Answers
Try this...
TEST.xlsm
The file has a macro which will do what you are wanting to do I believe. You will need to enable macros. Once in click the button on the monthly sheet that says "Run Macro"
The code is below:
Please Login or Register to view this content.
This works so awesome except the amount summed does not match the various months. For example, the macro returns the amount 2,021,438 for Hits January 2014 but it should be 446,601. Same is true for the other amounts. Thanks
That is because it is summing all Januaries irrespective of year. I didn't know you wanted only 2014.
Change this line:
To this...Please Login or Register to view this content.
BTW the way for this to work I changed you Month titles formatting from General to a custom formatting mmm, which essentially displays the Month only of any date entered. E.g. for Jan the cell contains 1/1/14...you could enter any day in January 2014 and the cell would still only show Jan. You could use this same technique if you wanted to keep other years separated.Please Login or Register to view this content.
I would then rename your Month tab to 2014. If you do this though you will need to change the following line:
To this...Please Login or Register to view this content.
And so on for all your yearsPlease Login or Register to view this content.
If your questions has been answered to your satisfaction please don't forget to do the following:
Add Reputation ... and ... Mark Thread as Solved
Thanks,
Ma 10:8b Freely you have received; freely give.
I tried to make the changes. Obviously I am doing something wrong. I would like to keep all the years on the same worksheet. I attached what I did.
TEST2.xlsm
I corrected the vba...
It works perfectly except it only updates Jan 2014. I experimented with changing the Monthly.Range but it didn't work.
[It only updates Jan 2014 because in your daily tab 2014 has only Jan data. You will need more data for 2014 for more months to be calculated.
Try this file. I made the other months contingent on the date in Jan. This should allow you to change the year in Jan and the years will change for the others. then rerun the code and it will calculate for that year.
ATTACH]296890[/ATTACH]
Spectacular. Thank you for your help!!
Can you tell me how to copy this macro to an existing workbook? I have tried numerous times. I tried copying by by dragging the module to the destination workbook but received the following error message: 'Name conflicts with existing module, project or object library'. I tried copying and pasting also.
It's because the module name is probably 'Module1" and you already have a "Module1" in your existing workbook. Delete your module 1 and then drag and drop the one from the test.
Can you tell me how you would change the macro to select by rows instead of by columns as you did in this case?
What exactly do you want to do with the data?
I am just experimenting with the data.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks