If statement help

Jazzer

Board Regular
Joined
Jun 14, 2011
Messages
71
Hi All,<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p></o:p>
<o:p></o:p>
I’m looking for an IF Statement which will hopefully be able to solve the following conundrum<o:p></o:p>
<o:p></o:p>
Column F contains four variations of text<o:p></o:p>
<o:p></o:p>
Opening Leg (Buy)<o:p></o:p>
Opening Leg (Sell)<o:p></o:p>
Closing Leg (Buy)<o:p></o:p>
Closing Leg (Sell)<o:p></o:p>
<o:p></o:p>
Column G contains numerical amounts (all positive)<o:p></o:p>
<o:p></o:p>
I would like column H to contain the exact amount in column G if column F contains Opening Leg (Buy) or Closing Leg (Sell)<o:p></o:p>

The amount in column G should be displayed as a negative in column H if column F contains Opening Leg (Sell) or Closing Leg (Buy)<o:p></o:p>
<o:p></o:p>
Many Thanks<o:p></o:p>
James<o:p></o:p>
<o:p></o:p>
 

Excel Facts

Will the fill handle fill 1, 2, 3?
Yes! Type 1 in a cell. Hold down Ctrl while you drag the fill handle.
Something like this:


=IF(OR(F4="Opening Leg(Sell)",F4="Closing Leg(buy)"),-G4,G4)
 
Last edited:
Upvote 0
One way would be

=choose(match(F2,{"Opening Leg (Buy)","Opening Leg (Sell)","Closing Leg (Buy)","Closing Leg (Sell)"},0),G2,-G2,-G2,G2)
 
Upvote 0

Forum statistics

Threads
1,224,609
Messages
6,179,879
Members
452,948
Latest member
Dupuhini

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