Index and Match with a pivot table

Copper Contributor

Hi,

 

I am working on making our sales reports less manual entry and want to use formulas to grab from a pivot table that has all our data.

 

The pivot table currently contains three of the seven data fields that I'm looking to get information from. As of right now the sales tracking spreadsheet has the reps name under column A. The formula has it starting at $A524 so when I drag and copy the formula it will just continue down to the next rep. When the formula is referencing the pivot table, in another spreadsheet, column A will always be absolute since it contains the reps names just like the sales tracking spreadsheet. The way I have the data set up for columns C-E, which contain the sales numbers, I only have the rows as absolute so when I drag and copy the column they will move to the next portion of data in the pivot table and pull that number into the sales tracking spreadsheet. This formula currently works for bringing back "0" when the rep doesn't have production in the pivot table but I get #VALUE! errors in the sales tracking spreadsheet when the sales reps name isn't in the pivot table.

 

 

=INDEX('Pivot_table'!C$4:C$29,IFNA(MATCH($A524,'Pivot_table'!$A$4:$A$29,0),"0"))

 Index(looking at the pivot table for the sales numbers, IFNA(MATCH(is looking for the rep name, in the first column of the pivot table for a match,0),"I'm not sure if this IFNA is working for what I need"))

 

Thanks for any help!

2 Replies

@alechanson 

I would suggest that you use GETPIVOTDATA(). It's a lookup function designed for pivot tables.

And IFNA() should be the outermost function.

 

@Detlef Lewin 

Thanks, I'll give that a try today!