Negative Number Problem

4 Barrel Harold

New Member
Joined
Jun 15, 2018
Messages
21
Here is the problem I need help with, K60 changes constantly and 0nce K60 gets below 190 it starts giving negative Numbers. How can I fix this formula not to do that, Thanks 4 Barrel Harold

Code:
[/=IF(NOT(OR(K60>(K56+K48))),IF(K59>K60,K60-K56)*N13,K48*N13)CODE]



Here are the number that I'm currently using in the cells, any thing entered below 190 into K60 gives a neg no. Probably a simple fix like a ,0) at the end or something

=IF(NOT(OR(K60>(190+883))),IF((190+883)>K60,K60-190)*0.0091,883*0.0091)
 

Excel Facts

Round to nearest half hour?
Use =MROUND(A2,"0:30") to round to nearest half hour. Use =CEILING(A2,"0:30") to round to next half hour.
Try without the OR:

=IF(K60>(K56+K48),IF((K59>K60,K60-K56)*N13,K48*N13)

By the way, the original formula seems to lead only to K48*N13 part, always!

What values are we comparing using the OR?
 
Last edited:
Upvote 0
KolGuyXcel
Hey I greatly appreciate you advice and you taking the time to get back with me, When I inserted your formula it didn't work like I wanted it gave me a True/False and #Value in cell. CGX I'm By no means a programmer so I don't know how to answer your question about where the formula is leading to LOL. Here is the original formula that I copied from offline =IF(NOT(OR(B6="red",B6="green")),C6*1.15,C6) Then I Pasted and played with it a few min to see if I could apply it to my sheet, after a few min I had tweaked the formula to this "=IF(NOT(OR(K60>(K56+K48))),IF(K59>K60,K60-K56)*N13,K48*N13)" So with that said I need the formula to not give a negative number when its finished calculating. So I tell ya what I do know in Ole Country Boy terms and if you of anyone else can fix and streamline it a bit I'd greatly Appreciate it.


I think that the part in-between the Quotes has to be rewritten =IF(NOT(OR(K60>(K56+K48))), """ IF(K59>K60,K60-K56)*N13 """" ,K48*N13)

Here's a mistake on my part I do see Now K59 is = to (K56+K48) which changes it to """ IF((K56+K48)>K60,K60-K56)*N13 """"
CORRECTION in the Code: I think that the part in-between the Quotes has to be rewritten =IF(NOT(OR(K60>(K56+K48))), """ IF((K56+K48)>K60,K60-K56)*N13 """" ,K48*N13)



I know that this part is checking the cells Greater Than/Less Than =IF(NOT(OR(K60>(K56+K48))),

So for Greater Than Part of it = K48*N13
which automatically calculates and inserts value, which works great

Now for the Less Than Part of it this is the part that's buggered up = """ IF((K56+K48)>K60,K60-K56)*N13 """"
and with the new if it checks again Greater Than/Less Than again. Now when K60=25 - K56=190 25-190= -165 which this negative number affects the over all total in another part of the workbook
 
Upvote 0

Forum statistics

Threads
1,223,893
Messages
6,175,244
Members
452,622
Latest member
Laura_PinksBTHFT

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