In this article, I have illustrated 25 powerful techniques and features of PivotTable. I have mostly covered advanced levels of Pivot Table in Excel. If you ...
If you want to comment on multiple lines in a VBA code to make the code easily understandable, this article can help you to do this in 3 simple steps. ...
Date Picker is a type of calendar from which you can navigate through the months and years and insert the date into the cell. In an Excel UserForm, a date ...
Remembering long Workbook names takes extra time and effort. Using VBA, you can activate a Workbook without remembering it’s full name. Isn’t it great? With ...
Are you trying to exit a Select Case Statement for a specific condition in Excel VBA? It greatly helps to optimize the performance of the code. Unfortunately, ...
Are you trying to move the X-axis of your Excel chart to the bottom? There are so many cases where you need to place the X-axis or horizontal axis at the ...
Are you looking for an Excel function that will return the standard deviation of the entire population and also match the given criteria? In this case, the ...
Looking for ways to create InputBox with password mask in Excel VBA? Then, this is the right place for you. To prevent shoulder spying, you should use a ...
In this article, I am going to explain how to calculate Stock to Sales Ratio Step-by-Step in Excel using formula. If you are new to Inventory Management and ...
Sometimes, you need to do something with a cell if it is not blank. If you are searching for a Microsoft Excel function that checks if a cell is blank or not, ...
If you want to navigate through multiple levels or categories of a dataset, then Drill Down Chart is the best possible option for you. In Excel, it is very ...
For loop is one of the most used loops in VBA. Unfortunately, VBA doesn’t have any Continue Statement like Python. But there may occur a situation where you ...
Scatter Plot Matrix is very handy to compare the bivariate relations of multiple variables. In this article, I will demonstrate how to create a Scatter Plot ...
Practically, the Material Reconciliation Format is one of the most used formats in Excel in manufacturing or construction processes. It is very handy to create ...
Pareto charts are used to identify the issues to focus on first in order to make improvements. This article walks readers through a few simple steps on how to ...
Dear Salad,
Thanks for your question. Here is the VBA code that will give you your mentioned output.
Following is the output after using the code.
Regards
Mahfuza Anika Era
ExcelDemy
Dear MARK,
Thank you for your query.
Here is the dataset I will use to show the solution to your problem.
After creating a PivotTable, I have copied the PivotTable 5 times. So, there are 5 PivotTables in my worksheet now.
Now, we have to create a drop-down menu from the list of PivotTables.
Next, copy this VBA code into your VBA code editor. You have to change three things in this code. These are: the cell address of where you placed the drop-down menu, the filter values, and the field name that you want to filter.
To get the output, select the PivotTable from the drop-down which you want to filter, and then Run the code by pressing the F5 key.
For your convenience, I have given the Excel file: Filtering PivotTable with drop-down menu.xlsm
Regards
Mahfuza Anika Era
ExcelDemy
Dear Stuart,
I am glad that you find this article informative. Thank you for your query. The VBA code which I have inserted in step 4 is in Sheet1 under Microsoft Excel Objects Section.
Mahfuza Anika Era
ExcelDemy
Dear Yosh,


Thank you for your query. Yes, you can determine the sum of YTD number. Firstly create a table like the following for each Month’s Sales of “Jimmy” for “Laptop”.
Copy this formula in cell C21.
=SUMIFS(INDEX($D$5:$I$16,,MATCH(B21,$D$4:$I$4,0)),$B$5:$B$16,$B$20,$C$5:$C$16,C$20)
You will get the sales for each month.
Next, to calculate the “YTD Grandtotal” copy this formula in cell C27.
=SUM(C21:C26)
I hope this method will solve your problem. Thank you!
Mahfuza Anika Era
ExcelDemy
Dear Yosh,
I assume, this question is same as the previous one. You can follow the steps I have given in the previous reply. If you still have any confusion, please leave a comment describing your problem. Thank you!
Mahfuza Anika Era
ExcelDemy
Dear L,
Thank you for your comment. This formula calculates a date value. Here is a breakdown of what each part of the formula does:
=$B$4-(WEEKDAY(C$3,1)-($AM$7-1))-IF((WEEKDAY($B$4,1)-($AM$7-1))<=0,7,0)+1
$B$4: This is the reference to cell B4 which contains the date value you enter in Customize Dates Table.
WEEKDAY(C$3,1): This function calculates the weekday of the date in cell C3. The argument 1 specifies that the weekday numbering should start on Monday (1) instead of Sunday (default value of 0).
$AM$7: This is a reference to the cell containing a number that specifies the Start Month. (e.g. 1 for Monday, 7 for Sunday).
IF((WEEKDAY($B$4,1)-($AM$7-1))<=0,7,0): This function checks whether the weekday of the date in cell B4 is earlier in the week than the specified start day of the week. If it is, the function returns 7 (the number of days in a week) to adjust the date calculation later. If not, the function returns 0.
B4-(WEEKDAY(C3,1)-($AM$7-1))-IF((WEEKDAY($B$4,1)-($AM$7-1))<=0,7,0)+1: This formula subtracts the weekday of the date in cell C3 from the date in cell B4, then adds the start day of the week minus 1, and finally subtracts the result of the IF function. This calculates the first day of the week that contains the date in cell B4. The final +1 adds one day to get the actual start date of the week.
If you want 4 weeks in one sheet, just add 3 more weeks similarly in the existing sheet. Hope this will help you.
Regards
Mahfuza Anika Era
ExcelDemy
Dear Max,
Thank you for your query. Changing the currency is not the reason behind the incorrect output of the module 2 code. Actually, the code is not working for the last 3 digits of the whole number part. Here is the modified code of module 1 that may help you. This will give the correct result hopefully.
Copy the code in your module and Run the code.
I hope you have got your problem solved. Thank you.
Regards
Mahfuza Anika Era
ExcelDemy