Which formula to use for negative margin %

wilkob

New Member
Joined
Nov 9, 2008
Messages
27
Hello,

Can someone help me with the following:

I am working on a spreadsheet with sales figures

For calculating the margin I take the sales value - cost
For calculating the margin % I take the margin /sales value

When I have a sales value > 0 there is no problem

When I have a sales value which is 0 I am getting in trouble
With a sales value of 0 and a cost >0 I am getting #DIV/0!
With a sales value of 0 and a cost of 0 I am getting #DIV/0!

How can I get a negative margin of 100% when I am selling at 0 with a cost > 0
How can I get a 0% margin when I am selling at 0 with a cost of 0
(I know it sounds mad but we have transactions like this)

many thanks in advance for your help
 

Excel Facts

Last used cell?
Press Ctrl+End to move to what Excel thinks is the last used cell.
Code:
      --A-- -B-- --C--- ----------------------D-----------------------
  1   Price Cost Margin                                               
  2      0    0      0% C2: =IF(price, 1 - cost/price, IF(cost,-1, 0))
  3    100   80     20%                                               
  4      0   80   -100%
 
Upvote 0
Thanks for the formula but it seems to only work on the sales where i have a -100%

Just for your information I am working with this formula in a pivot table:

=IF(('Sales value'); 1-'Cost'-'Sales value'; IF(('Cost');-1;0))

The results that I am having are completely wrong:

Sales Value .............Cost .............Margin.......... Margin %
4810,43 ..............2651,18 ........2159,25 ........-746061,34%
536,00 ..............402,60 .........133,40 .........-93760,00%
0,00 ...............996,25 .........-996,25 ..........-100,00%


Sorry for the points but I don't know how to put tabs :)

I am not sure if it is at all important but I am using Excel 2007, which is also the reason for the ; instead of the ,
 
Upvote 0

Forum statistics

Threads
1,214,979
Messages
6,122,561
Members
449,089
Latest member
Motoracer88

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.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

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

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

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
Back
Top