Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 16
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,939
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 471
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
how to create pivot table from existing pivot table in excel 2007 Udayraj Dhulekar Excel Discussion (Misc queries) 2 July 8th 13 08:22 PM
Pivot Table and Pivot Table dates are not in correct order ls Charts and Charting in Excel 3 July 14th 09 04:02 PM
Pivot Table - Multiple Page Fields - AND/OR Logic Choice? what_the_excel Excel Discussion (Misc queries) 1 March 10th 09 11:26 AM
Logic to Determine if a Data Pivot Field Exist? ExcelMonkey[_103_] Excel Programming 0 March 4th 04 09:09 PM
Help required with setting up a pivot table with the source on sheet1 to have the pivot table created on sheet called "report" Diana[_5_] Excel Programming 0 August 21st 03 10:19 PM


All times are GMT +1. The time now is 08:43 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"