Good morning, I'd like to ask a very basic question. I have a Pivot Table that consists of Names and Total Amount. Something like this:
A1 B1
Name1 1
Name2 1
Name3 1
Name4 1
Name5 1
Name6 1
Name7 1
Name8 1
Name9 2
Name10 2
etc.
I want to randomly choose 4 of those names. I found the following formula: =INDEX(data,RANDBETWEEN(1,ROWS(data)),1) It works perfectly when I change "data" to the range of the Pivot Table, for example A1:B10, the problem is that I have to change the formula everytime I update the table. I want to do it dynamically. The Pivot Table name is "FilteredNames", when I try to replace it instead of "data", I get an error. Is there any way to reference a pivot table or in any case, an easier way to achieve what I want to do?
A1 B1
Name1 1
Name2 1
Name3 1
Name4 1
Name5 1
Name6 1
Name7 1
Name8 1
Name9 2
Name10 2
etc.
I want to randomly choose 4 of those names. I found the following formula: =INDEX(data,RANDBETWEEN(1,ROWS(data)),1) It works perfectly when I change "data" to the range of the Pivot Table, for example A1:B10, the problem is that I have to change the formula everytime I update the table. I want to do it dynamically. The Pivot Table name is "FilteredNames", when I try to replace it instead of "data", I get an error. Is there any way to reference a pivot table or in any case, an easier way to achieve what I want to do?