Excel Dynamic Chart Title (Top n) - excel

Is it possible to create a dynamic Excel Pivot Chart title that includes "(Top n)" where n = the value filter row limit selected by the user? I know the chart title can be set to the contents of a cell but am unsure how to go about determining the Top n limit selected by the user or how to add that in the cell formula. If this is possible, any assistance would be greatly appreciated. Thanks!

Max didn't work as I need the row count (n) after the user applies a value filter of Top n. However, your response steered me in the right direction and I was able to accomplish what I was looking for with ="(Top "&SUBTOTAL(103, A2:A140) &")" . Supposedly, SUBTOTAL with the first parameter set to 103 will perform a COUNTA function but ignore hidden rows. Reference: https://exceljet.net/excel-functions/excel-subtotal-function

So use max() on the range of cells and concatenate - I like the & (less typing):
=(Top &MAX(A21:A24)&")"
Just for those who don't know how top get the cell result into the title:
Select the chart title box (so it has blue corners
In the formula bar type "=" and select the cell with the contents and enter.

Related

Index/Match returning wrong value

Summary tab:
Source tab:
I'm having some trouble using index match combo and getting the data to reference correctly.
what I am trying to achieve is in a tab called "Summary" I have a calendar with range D5:O6. the first cell in the calendar should change everyday to reflect the current date which will change the rest of the row making a rolling calendar. I have a data reference sheet called "PFS" from which the data needs to be referenced.
The thing I'm having trouble with is that with the formula
=INDEX(PFS, MATCH(A8,Snames,0),MATCH(D5,Sdates,0))
is returning the top left intersection (B8 of the source tab) of A8 and D5 values smith, bob & 4-Aug. a cell that i have entered the value "Wrong Corner".
Snames A8:A9, Sdates D5:O5 are the rows and columns containing the dates and names from the Summary tab
what I need help with is why its returning the wrong intersection and what I can do different to get the data I'm looking for.
The correct return would be the number one, which I have conditionally formatted to turn the cell blue and blank the text
You don't show what PFS references to. It seems to start in A1.
You can either use a range that starts in the correct cell, or add the required offset to the Match results.
=INDEX(PFS, MATCH(A8,Snames,0)+2,MATCH(D5,Sdates,0)+2)
Also make sure that Sname and Sdates refer to the ranges in the Source tab, not the Summary tab.

Excel : have cell range stored in cell to be used by combobox

I am using a ComboBox (basically a drop-down list) in excel, and I would like to select a value from a range. Thing is, I have around 15 of those comboboxes that are linked to the same list, and I'd like to not have to modify the ranges for all of them if I add a value to my list.
Hence my idea of telling the dropdown to take the array given in cell A1 of my data sheet as input for the actual array...
I'm not sure I'm being clear so here's an example : my list is in the range A3:A25. I want to have "A3:A25" written in cell A1, and have my dropdown list take the value of A1 as the actual range, so that if I add an entry to the list I can change A1 to "A3:A26" and not have to change all of my lists.
Thanks in advance
Change the reference to:
=$A:$A
Be sure to tick Ignore blank.
Turns out I just selected my list and called it "List" (right click, -> define name), and defined the input range as "List".
Now if I add a value, I just have to redefine List.
Thanks

Is it possible to display a value based on presence of a cell border?

We are looking at doing some data import. There is a very large complex sheet which has some items grouped together using borders around cells in one column. The only indication that the items are grouped is the fact the group is surrounded by a border. Items ungrouped have no left and right border on the cell (may have top and bottom border as items above and below maybe grouped). As an initial exercise we want to add a column that displays true if an item is grouped. So if there is a border display a value like one. Does anyone know if this possible?
Use this custom VBA function:
Public Function GetBorder(ByVal Rng As Range, Idx As Integer) As Boolean
GetBorder = Rng.Borders(Idx).LineStyle <> xlNone
End Function
It takes two arguments: cell and index of border (7=left, 8=bottom, 9=top, 10=right). Returns TRUE or FALSE.
Now if you want to get info about bottom border of cell A1 you should:
=GetBorder(A1,8)

passing parameter to build a dynamic string in excel

My requirement is very simple but i am not finding it easy-
In excel, column A is having 'Table name' and column B is having 'Column name'
I want to write a query-
Select * from 'column A' where 'column B' is not null.
In excel I have 2578 lines so I dont want to write 2578 Select statements.
any expert help in Excel?
I doubt this is your answer, but may help towards what you want. Based on #user3514930's approach:
With data as in the top left corner, select the two columns and click on DATA > Sort & Filter - Filter. Click on the arrow in the Column name cell and on (Blanks) in the dropdown. You should then see the equivalent of what is in the lower range. This can be copied and pasted elsewhere in the sheet, if you wish.

PivotTable's Report Filter using "greater than"

I have a pivot table which has one of the fields (Probability) in a Report Filter. Its values are percentages in step of 5 (0,5,10,15,...,100). I'd like to use it to filter probabilities greater than or equal a certain value, but the filter only filters exact choices.
For now I use a workaround of allowing multiple values, and then selecting all values from the threshold I want, all the way to 100
This solution, apart from being awkward, doesn't show my selection, which is necessary as this table is being printed out.The Filter's display value is "(Multiple Values)" and I'd like to show all the values selected, or even better, something like ">=20%". I don't really care if they show in the field itself or in another cell outside the Pivot table.
My questions:
1) can I get the filter to filter on >= of my seletion? If not
2) Can I show the multiple selections like ">=20%"
I know this is a bit late, but if this helps anybody, I think you could add a column to your data that calculates if the probability is ">='PivotSheet'$D$2" (reference a cell on the pivot table sheet).
Then, add that column to your pivot table and use the new column as a true/false filter.
You can then change the value stored in the referenced cell to update your probability threshold.
If I understood your question right, this may get you what you wanted. The filter value would be displayed on the sheet with the pivot and can be changed to suit any quick changes to your probability threshold. The T/F Filter can be labeled "Above/At Probability Threshold" or something like that.
I've used this to do something similar. It was handy to have the cell reference on the Pivot table sheet so I could update the value and refresh the pivot to quickly modify the results. The people I did that for couldn't make up their minds on what that threshold should be.
In an Excel pivot table, you are correct that a filter only allows values that are explicitly selected. If the filter field is placed on the pivot table rows or columns, however, you get a much wider set of Label Filter conditions, including Greater Than. If you did that in your case, then the added benefit would be that the various probability levels that match your condition are shown in the body of the table.
One way to do this is to pull your field into the rows section of the pivot table from the Filter section. Then group the values that you want to keep into a group, using the group option on the menu. After that is completed, drag your field back into the Filters section. The grouping will remain and you can check or uncheck one box to remove lots of values.
After some research I finally got a VBA code to show the filter value in another cell:
Dim bRepresentAsRange As Boolean, bRangeBroken As Boolean
Dim sSelection As String
Dim tbl As Variant
bRepresentAsRange = False
bRangeBroker = False
With Worksheets("Forecast").PivotTables("ForecastbyDivision")
ReDim tbl(.PageFields("Probability").PivotItems.Count)
For Each fld In .PivotFields("Probability").PivotItems
If fld.Visible Then
tbl(n) = fld.Name
sSelection = sSelection & fld.Name & ","
n = n + 1
bRepresentAsRange = True
Else
If bRepresentAsRange Then
bRepresentAsRange = False
bRangeBroken = True
End If
End If
Next fld
If Not bRangeBroken Then
Worksheets("Forecast").Range("ProbSelection") = " >= " & tbl(0)
Else
Worksheets("Forecast").Range("ProbSelection") = Left(sSelection, Len(sSelection) - 1)
End If
End With
Maybe in your data source add a column which does a sumif over all rows.
Not sure what your data looks like but something like =(sumif([column holding pivot row heads),[current row head value in row], probability column)>.2).
This will give you a True when the pivot table will show >20%.
Then add a filter on your pivot table on this column for TRUE values
I can't say how much this might help you, but just found a solution to something similar problem which I faced.
In the Pivot-
Right click and choose Pivot table options
Choose the display option
uncheck the first 'Show expand/Collapse buttons'
check the 'Classic PivotTable Layout(enables dragging of fields in the grid)
click ok.
This would refine the data. Then, I had just copy and pasted this data in a new tab wherein I had applied the filters to my Total column with values greater than certain percentage.
This did work in my case and hope it helps you too.
Use a value filter. Click the dropdown arrow next to your Row Labels and you'll see a choice between Sort A to Z, Label Filters, and Value Filters. Selecting a Greater Than value filter will let you choose which column to use to filter out rows, even if that column has no dropdown arrow itself.

Resources