Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Pivot Table - Using If Then logic
Can you use If Then logic in a calculated field?
I have table of data that is downloaded from an external source. The amount field is all positive numbers. The adjacent field indicates if the amount represents a debit or credit value. I would like to set up a calculated field that to sum the amount field but I need to have the debit and credits sum to a net number and not a straight sum. Any thoughts on this? I'm trying to avoid manipulating the entire table to change the sign on the credit values. thanks |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Pivot Table - Using If Then logic
You can not use if then logic in a pivot table. You need to add the logic to
your source data. -- HTH... Jim Thomlinson "blkane" wrote: Can you use If Then logic in a calculated field? I have table of data that is downloaded from an external source. The amount field is all positive numbers. The adjacent field indicates if the amount represents a debit or credit value. I would like to set up a calculated field that to sum the amount field but I need to have the debit and credits sum to a net number and not a straight sum. Any thoughts on this? I'm trying to avoid manipulating the entire table to change the sign on the credit values. thanks |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Pivot Table - Using If Then logic
If using VBA, I would replace the amount column with the new "adjusted" amount:
let's say Col I has the Amount and Col J has "Dr" or "Cr" code: x=1 Do while true if cells(x,1).value=empty then exit do 'something to find last row of data, may 'have to adjust let Amt=cells(x,9).value if cells(x,10).value="Dr" then 'do nothing, it is positive! else let cells(x,9).value=-1*amt end if x=x+1 Loop "blkane" wrote: Can you use If Then logic in a calculated field? I have table of data that is downloaded from an external source. The amount field is all positive numbers. The adjacent field indicates if the amount represents a debit or credit value. I would like to set up a calculated field that to sum the amount field but I need to have the debit and credits sum to a net number and not a straight sum. Any thoughts on this? I'm trying to avoid manipulating the entire table to change the sign on the credit values. thanks |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
how to create pivot table from existing pivot table in excel 2007 | Excel Discussion (Misc queries) | |||
Pivot Table and Pivot Table dates are not in correct order | Charts and Charting in Excel | |||
Pivot Table - Multiple Page Fields - AND/OR Logic Choice? | Excel Discussion (Misc queries) | |||
Logic to Determine if a Data Pivot Field Exist? | Excel Programming | |||
Help required with setting up a pivot table with the source on sheet1 to have the pivot table created on sheet called "report" | Excel Programming |