# adding a formula in a pivot table (using the same field)

#### fab54

##### New Member
Hi guys,
I know how to add a formula using different fields but I'm not sure if you can do id using values in the same field.
Look at the following table:
<table x:str="" style="border-collapse: collapse; width: 96pt;" width="128" border="0" cellpadding="0" cellspacing="0"><col style="width: 48pt;" span="2" width="64"> <tbody><tr style="height: 12.75pt;" height="17"> <td style="height: 12.75pt; width: 48pt;" width="64" height="17">Field 1</td> <td style="width: 48pt;" width="64">Field 2</td> </tr> <tr style="height: 12.75pt;" height="17"> <td style="height: 12.75pt;" height="17">A</td> <td>x</td> </tr> <tr style="height: 12.75pt;" height="17"> <td style="height: 12.75pt;" height="17">A</td> <td>y</td> </tr> <tr style="height: 12.75pt;" height="17"> <td style="height: 12.75pt;" height="17">B</td> <td>x
</td> </tr> <tr style="height: 12.75pt;" height="17"> <td style="height: 12.75pt;" height="17">B</td> <td>y</td> </tr> </tbody></table>
I would like to add a new field in the pivot table (without adding it in the data) that returns (for example) x*y (multiplying all the values in field 2).

Is that possible?

Many thanks

### Excel Facts

Test for Multiple Conditions in IF?
Use AND(test, test, test, test) or OR(test, test, test, ...) as the logical_test argument of IF.

#### Andrew Poulsom

##### MrExcel MVP
If Field 2 contains numbers you can add a calculated item that multiplies A by B. If that's not what you want, post a small but representative sample of your real data and explain what you do want.

#### fab54

##### New Member
If Field 2 contains numbers you can add a calculated item that multiplies A by B. If that's not what you want, post a small but representative sample of your real data and explain what you do want.

Hi Andrew, that's exacly what I want but I don't know how to do it.
When I go to pivot table -> formulas -> calculated field I can only "play" with fields.
I can create a new field 3= field1 * field 2 (that I know how to do it)
but I cannot make field 3 = A*B

#### Andrew Poulsom

##### MrExcel MVP
You need calculated Item not calculated field.

#### fab54

##### New Member
You need calculated Item not calculated field.

It worked!!!

Thank you very much Andrew

Replies
2
Views
204
Replies
0
Views
486
Replies
0
Views
140
Replies
0
Views
453
Replies
1
Views
205

1,191,360
Messages
5,986,196
Members
440,010
Latest member
cdotshel

### We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.

### Which adblocker are you using?

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

### Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

### Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back