Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Subtracting a Negative Integer

Status
Not open for further replies.

elf1

Technical User
Jun 6, 2001
43
US
Good Evening,

I need to create a formula that will subtract a -1 from a value.
How would I do this? I am uncertain of the syntax.

Thank You So Much,
Lisa
 
Subtracting a negative value is the same as adding a value, i.e., -(-1) = +1. But I'm guessing you are asking how to subtract 1 from a value. If so, go to formula->new and enter:

{table.amt}-1

If this isn't what you mean, please provide more detail about what you are trying to do.

-LB
 
And good evening to you, Lisa.

Specifics, such as your software version are important to share when requesting technical assistance.

LB has suggested a simplistic example of doing so, perhaps we'd all be better served were you to state specifics, such as:

Crystal version
Database/connectivity used
Example data
Expected output

-k
 
Greetings,

I am using Crystal 8.5. I need to create a formula that will display Gross Profit Percent.

The formula I currently have in place is
IF {SOH_CustSlsHistory.DollarsSoldPeriod8}<>0 THEN {SOH_CustSlsHistory.CostOfGoodsSoldPeriod8}/{SOH_CustSlsHistory.DollarsSoldPeriod8}- (-1.00) *100

If you take 1288.20 divided by 1788.87 - (-1.00) *100
you should get 27.98

I get 100.7201.
Something is wrong with my formula.

Please Help,
Lisa







 
Try

IF {SOH_CustSlsHistory.DollarsSoldPeriod8}<>0 THEN
1 -
(
{SOH_CustSlsHistory.CostOfGoodsSoldPeriod8}%{SOH_CustSlsHistory.DollarsSoldPeriod8}
)

 
Thank you for your response.

I tried this and it doesn't give me the desired result.

Any other suggestions?

 
What exactly are you trying to do in the formula?
It looks like you want to want to multiply -1 and 100=-100
Subtract that from 1788.87 = 1888.87
and then divide 1288.2 by the result.
= 0.68.

I don't understand where you get 100.7201 from.
 
Hi,
Thanks for helping me.

This formula is supposed to determine Gross Profit Percentage.

I can get this to come out on a calculator, but not in the formula I am trying to create.

The calc is Cost of Goods / Sales Minus (-1) Times 100

If I take 1288.20 and divide by 1788.87, I get 0.7201
Cost of Goods / Sales
This is correct

Then I need to take the 0.7201 and Subtract (-1), I should get 0.2798 then multiply by 100 gives me 27.98

I have tried many formula combos and don't even come up with the right number, in Crystal

I am having trouble with the correct syntax.
Does this make sense?

I could send the report and data, if needed.

Thank You


 
I don't agree with:

"Then I need to take the 0.7201 and Subtract (-1), I should get 0.2798"

That would give you 1.7201.I think you mean take away the result from one?


100*(1-(Goods/Sales))

should work (brackets exactly as above).

What exactly does that formula give you?
 
Katy44,

Thank You, this is exactly what I was looking for!

You are awesome!
Lisa
 
Since I used the % rather than /, it sould have been

IF {SOH_CustSlsHistory.DollarsSoldPeriod8}<>0 THEN
100 -
(
{SOH_CustSlsHistory.CostOfGoodsSoldPeriod8}%{SOH_CustSlsHistory.DollarsSoldPeriod8}
)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top