Not Returning a Negative

nsnodgrass73

New Member
Joined
Jan 2, 2025
Messages
4
Office Version
  1. 365
Platform
  1. Windows
I have this formula:

=IFERROR(IF(OR(O28<0,P28<0),O28+P28,""),"")

Where as O28 is -$2165.80 and P28 is $14195.00 and Q28 returns $12029.30. This needs to return -$12029.30.

I have also tried:

=IFERROR(IF(O28<0, O28+P28,IF(O28>0,O28-P27,0)),0)

neither are returning a negative number. I have formatted the cells Number >> (-2165.80)

I need the formula to look and see if O is a positive or negative and then do the math correctly with P (is always positive) resulting in Q.
 

Attachments

  • Screenshot 2025-01-15 163628.png
    Screenshot 2025-01-15 163628.png
    1.9 KB · Views: 6
  • Screenshot 2025-01-15 163718.png
    Screenshot 2025-01-15 163718.png
    4.7 KB · Views: 6

Excel Facts

What is the fastest way to copy a formula?
If A2:A50000 contain data. Enter a formula in B2. Select B2. Double-click the Fill Handle and Excel will shoot the formula down to B50000.
This needs to return -$12029.30.
That contradicts the logic in your formula; formula says it should return the null string.

P (is always positive)
If P is always positive, why are you checking it in the first formula?

Can you explain the logic of why you want to get the opposite of the correct sign as the result of adding numbers? I really cannot imagine any real-world reason to do this. It might help to explain your reasoning.

But if you want the negative of the correct result if O<0, then
Excel Formula:
=(P28+O28)*IF(O28<0,-1,1)
 
Upvote 0
That contradicts the logic in your formula; formula says it should return the null string.


If P is always positive, why are you checking it in the first formula?

Can you explain the logic of why you want to get the opposite of the correct sign as the result of adding numbers? I really cannot imagine any real-world reason to do this. It might help to explain your reasoning.

But if you want the negative of the correct result if O<0, then
Excel Formula:
=(P28+O28)*IF(O28<0,-1,1)
Thank you. That's what I needed.
 
Upvote 0

Forum statistics

Threads
1,225,626
Messages
6,186,094
Members
453,337
Latest member
fiaz ahmad

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