Forum Discussion

Juan_Moreno's avatar
Juan_Moreno
Copper Contributor
Jan 10, 2024
Solved

Help with Pivot Tables

Hello, I have an issue. I'm using Excel in the web version, and I was asked to link two sheets. The first sheet retrieves its data from the second sheet, which contains the data in a pivot table. The pivot table has two columns: the first one is a CODE, and the second one is STOCK. Both columns are filled down with many rows. On the left, you have the product code, and on the right, the corresponding quantity.

The idea is that on the first sheet, I want to enter a code (which is clearly in the pivot table on the second sheet) in the first cell of the first column. I want it to be automatically filled with the STOCK from the adjacent cell. In other words, when I manually enter the code on the first sheet, I want it to search for the code in the pivot table and provide me with the quantity in the cell to the right.

I've tried using commands like IMPORTARDATOSDINAMICOS, which in my language serves the same function as GetPivotData, but for some reason, I can't obtain the desired data.

 

The syntax for the function is:

 

IMPORTARDATOSDINAMICOS(data_field, pivot_table, [field1, item1, field2, item2], ...)

 

I hope to receive guidance, and thank you in advance.

 

  • Hello Juan_Moreno 

     

    Corresponding sample shared here:

     

    As you can see above in the source of my PivotTable the values are in column [Value]

    So, with the PivotTable in B4 in sheet 'PivotTable' the formula in C4 is:

     

    =IFERROR(
      GETPIVOTDATA("Value", PivotTable!$B$4, "CODIGO", [@CODIGO]),
      "Not found"
    )

     

    or if you prefer:

     

    =IFERROR(
      GETPIVOTDATA("Value", PivotTable!$B$4, "CODIGO", B4),
      "Not found"
    )

     

  • Lorenzo's avatar
    Lorenzo
    Silver Contributor

    Hello Juan_Moreno 

     

    Corresponding sample shared here:

     

    As you can see above in the source of my PivotTable the values are in column [Value]

    So, with the PivotTable in B4 in sheet 'PivotTable' the formula in C4 is:

     

    =IFERROR(
      GETPIVOTDATA("Value", PivotTable!$B$4, "CODIGO", [@CODIGO]),
      "Not found"
    )

     

    or if you prefer:

     

    =IFERROR(
      GETPIVOTDATA("Value", PivotTable!$B$4, "CODIGO", B4),
      "Not found"
    )

     

Resources