# Microsoft Office Application Help - Excel Help forum > Excel Formulas & Functions >  >  Can I use IF function in calculated fields in a pivot table?

## Bloke in Excel Trouble

I want to add a logical function to the calculated field but I don't seem
able top do so - is there a limit on the functions you can use?

----------


## Peo Sjoblom

If you are referring to a text value like

=if(field2="name",

then you can't since all the text values are seen as zero in a calculated
field. AFAIK the only way is to add the if function to the source data
--

Regards,

Peo Sjoblom

Excel 95 - Excel 2007
Northwest Excel Solutions
www.nwexcelsolutions.com
"It is a good thing to follow the first law of holes;
if you are in one stop digging."  Lord Healey


"Bloke in Excel Trouble" <Bloke in Excel Trouble@discussions.microsoft.com>
wrote in message news:86CC6E01-758B-4969-9E23-2C416B1238C6@microsoft.com...
>I want to add a logical function to the calculated field but I don't seem
> able top do so - is there a limit on the functions you can use?

----------


## Charles Williams

There are limits on the functions you can use but IF is ok:
=IF(Sales>0,PROFIT/SALES,0)


--
Charles Williams
Decision Models

"Bloke in Excel Trouble" <Bloke in Excel Trouble@discussions.microsoft.com>
wrote in message news:86CC6E01-758B-4969-9E23-2C416B1238C6@microsoft.com...
>I want to add a logical function to the calculated field but I don't seem
> able top do so - is there a limit on the functions you can use?

----------

