Positive or negative figure depending on whats in cells.

ghrek

Active Member
Joined
Jul 29, 2005
Messages
301
Hi

I have a workbook that I need a formula for if poss.

What it is if C8 value is GREATER than D8 then I need H8 shown as a negative figure
and
If C8 is LESS that D8 then I need H8 shown as a positive figure.

Any Ideas?
 

Excel Facts

What did Pito Salas invent?
Pito Salas, working for Lotus, popularized what would become to be pivot tables. It was released as Lotus Improv in 1989.

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
62,236
Office Version
  1. 365
Platform
  1. Windows
What happens if C8=D8?
 

Marc L

Well-known Member
Joined
Apr 5, 2021
Messages
1,237
Office Version
  1. 2010
Platform
  1. Windows
Hi,​
what is the cell H8 actual formula ?!​
 

ghrek

Active Member
Joined
Jul 29, 2005
Messages
301
Fluff
If C8=D8 then I need the value shown as 0.00

Marc
Cell H8 is not a formula but a value.

What im trying to do is there are 2 values 1 in C8 and 1 in D8. Sometimes one is greater or less than the other and I need the difference showing in H8
 

Marc L

Well-known Member
Joined
Apr 5, 2021
Messages
1,237
Office Version
  1. 2010
Platform
  1. Windows

ADVERTISEMENT

(removed)
 
Last edited:

Marc L

Well-known Member
Joined
Apr 5, 2021
Messages
1,237
Office Version
  1. 2010
Platform
  1. Windows
So the H8 formula is obviously
Excel Formula:
=D8-C8
 
Solution

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
62,236
Office Version
  1. 365
Platform
  1. Windows

ADVERTISEMENT

In that case how about
Excel Formula:
=H8*SIGN(D8-C8)
 

ghrek

Active Member
Joined
Jul 29, 2005
Messages
301
Marc

That works what you said is there anyway I can get it to show as a -xx.xx rather than just a negative figure in red.
 

Marc L

Well-known Member
Joined
Apr 5, 2021
Messages
1,237
Office Version
  1. 2010
Platform
  1. Windows
Just format the cell according to the expected layout like "##.##" or "0.00" …​
 

Forum statistics

Threads
1,141,045
Messages
5,703,922
Members
421,321
Latest member
blusky4

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
Top