Assistance Combining Two Codes

honkin

Active Member
Joined
Mar 20, 2012
Messages
385
Office Version
  1. 2016
Platform
  1. MacOS
Hi

I have 2 lots of code that I need to combine to give a result, but it is beyond my skill to do it. I assume it will be using OR somehow, but just not 100% exactly how to do it.

=IF(AND(G1256="LOST",F1256<=10),95,0)
=IF(AND(G1256="WIN",F1256<=10),-100*F1256+100,0)

Both sections seem to work well on their own, so just need them to work as a single calculation.

Basically, what I am trying to do in English is the following:-

If the word LOST is in cell G*** and the price in F*** is less than or equal to 10, put 95; if it's above 10, put zero. But if the word is Win in cell G*** and the price in F*** is less than or equal to 10, do the calculation of the loss, -100 x F*** less 100; if above 10, put 0.

So, as you can see, there are only three possible answers, 95, 0 or the calculation of the loss.

If someone knows how to combine these correctly, it would be much appreciated.

Thanks in advance
 

Excel Facts

Did you know Excel offers Filter by Selection?
Add the AutoFilter icon to the Quick Access Toolbar. Select a cell containing Apple, click AutoFilter, and you will get all rows with Apple
Maybe this

Code:
=IF(AND(G1256="LOST",F1256<=10),95,IF(AND(G1256="WIN",F1256<=10),-100*F1256+100,0))
 
Upvote 0
How about
=IF(F1256>10,0,IF(G1256="LOST",95,IF(G1256="WIN",-100*F1256+100,"")))
 
Upvote 0
Maybe this

Code:
=IF(AND(G1256="LOST",F1256<=10),95,IF(AND(G1256="WIN",F1256<=10),-100*F1256+100,0))

My apologies for the delay, Michael. Yes, that works brilliantly

Thanks so much

regards
 
Upvote 0

Forum statistics

Threads
1,223,897
Messages
6,175,270
Members
452,628
Latest member
dd2

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