VLOOKUP + PIVOT TABLE DATA - excel

OBJECTIVE
Given a group of Clients, group each client into "discount" buckets based off of annual sales.
SETUP
Pivot Table with Customer Name, Annual Sales
Table with pricing categories (Bronze, Silver, Gold)
APPROACH
VLOOKUP(ANNUAL SALES, PRICING[ALL],2) - if a client exceeds a certain threshold in the PRICING table, they'll be listed as the corresponding PRICING bucket (e.g "GOLD").
ISSUES/QUESTIONS
VLOOKUP doesn't work well with pivot tables, especially if I collapse parent categories in excel. Is there a way to create a calculation field (that works with the pivot table, regardless whether or not parent categories are collapsed/hidden) that will essentially perform a VLOOKUP on a pricing table?

There is the function GetPivotData which is very powerful to use.
Have a look at this: GetPivotData formula (Contextures)
Bear in mind that the structure of the PivotTable needs to be stable, else you may get unexpected results.
You can also use INDEX / MATCH to get data from PivotTables, advantage of index/match is that you can use the row data as well as the value fields (whereas GetPivotData is limited to value fields).

SOLUTION
By using VLOOKUP and SUMIFS, I was able to develop a formula that would:
Create Pricing Categories
Categorize Customer purchases based off of three attributes (e.g
customer, Product, Configuation) and sum revenue
Categorize Pricing Tier based on total revenue spent
FORMULA
=VLOOKUP(SUMIFS(Sales Revenue, Client ID, Product, Configuration),PRICING TABLE, PRICING TIER, TRUE)
The Formula sums all Sales revenues that match the Client's ID, Product, and the Product's configuration (e.g Total Revenue per Client, per Product). The VLOOKUP formula uses this value and compares against a pricing table.

Related

Returning Highest earning product by date

Im trying to figure out my best option of presenting the data and also the formula if needed. I need to find the highest earning product of every month. I am using a pivot but I do not think that is the right analysis tool to use in google sheets. I can only use excel or google sheets. I have columns for the following:
Product Name
Sales
Net Revenue
Month #
Month Name
Year
Calendar Quarter
Country
Vertical
Units Sold
Commission
Sales Rep
I've tried filtering using different combinations on the pivot table.
Column A Column B
January Car
February Truck
March Hybrid
April Van
Welcome to SO. If you can use Excel, you can use Pivot Tables to get what you want.
First, because you did not create a Minimal, Complete, and Verifiable example, I made up some fake data. Let's say you got a list with earnings of each product kind of like this:
Second, I got an spanish version of Excel 2007 (yeah, old, but it works!), so if you got Excel higher than 2007, the option I will be naming in my answer my have changed a little bit, but indeed they are still there!!
About a solution, I've selected all the data above, and created a Pivot Table like this:
DATE and PRODUCT to section rows (DATE must be the first one)
EARNING to values section, summing up
Group the DATE field by month Group or ungroup data in a PivotTable
Last step, but important. Apply a value filter in field PRODUCT but selecting option TOP 10, and choose TOP 1 by field of SUM OF EARNINGS.
You will get this Pivot Table:
As you can see, the Pivot Table shows the max earnings of each month, with the name of the product.
Hope this can help!

Sum employees based on mapping in another table

I have one dynamic named range where I have the employees and their opportunities listed. the table also has a subtotal by employee. I have another table where I have a list of teams and the employees on those teams. The two tables are not the same size.
How do I sum up the employee totals from table 1 if they belong on the same team? In other words, how do I get the team total?
There is a similar question with an answer but when I try to use the sumif based on that answer, i am getting a #value error as the criteria range is not the same size.
Thanks

Counting/summarizing values using filtered table in Excel

Is it possible to count/summarize a value in a filtered excel table and subdivide that count based on another parameter (without using macro/VBA)? For example one grocery store can sell multiple items. I want to filter by the store, and then summarize the result based on the item. The image below shows my current formula, it does't work as described (it summarizes the entire items column). I want it to show count for apples as 3 and average price 1.75. If I apply filter to only show Mike's Grocery items, then the count should be 1 and average price 2.25.
Subtotal does not include any criteria for your conditions, and building this with formulas is a bit unwieldy and possibly overkill.
Consider using a Pivot table for your results table and use pivot table filters or slicers instead of filtering the source data.
If you want to use the Subtotal approach, take a look at https://exceljet.net/formula/count-visible-rows-only-with-criteria

EXCEL- Rank values in pivot table based on filter of another column

I have a list of customer accounts which needs to be ranked based on the revenue. But I want them to be ranked for each market. Basically in the pivot table Market is the filter.I want to use rank function and dynamically generate a rank based on the market filtered.Could anyone suggest a way to do this?.Thanks.

How to rank within category in Excel?

I have a list of customers by region with sales value. I want to create an overall ranking of all customers by sales values as well as the ranking of customers by sales value within the region and use both the ranking to calculate a score. is there a way to do this in Excel?
Either formulae or VBA code would be helpful for me.
Clearly for overall rank you can use RANK function, e.g. with Customers in A2:A100, Regions in B2:B100 and Sales value in C2:C100 you can use this formula in D2 for overall customer rank by sales value (highest ranks 1)
=RANK(C2,C$2:C$100)
for RANK within region you can use this version in E2 copied down
=SUMPRODUCT((B$2:B$100=B2)*(C$2:C$100>C2))+1

Resources