I tried but cannot get a formula to give me the result.
I am looking for a formula for ColH (Calc) that will do the following:
If Name1 OR Name2 is Fred And Type is A, For Side=Sell (PriceB-Price), For
Side=Buy (Price-PriceB)
Name1Name2SideTypePricePriceAPriceBCalc
FredBlankBuyA2231
BlankFredSellA5461
Thank you in advance.
=if(and(or(a1=quot;fredquot;,b1=quot;fredquot;),d1=quot;aquot;),if(c1=quot;buy quot;,e1-g1,g1-e1))--
kraljb
------------------------------------------------------------------------
kraljb's Profile: www.excelforum.com/member.php...foamp;userid=9955
View this thread: www.excelforum.com/showthread...hreadid=523627In cell H2:
=IF(AND(OR(A2=quot;Fredquot;,B2=quot;Fredquot;),D2=quot;Aquot;),IF(C2=quot;Sel lquot;,G2-E2,E2-G2),quot;quot;)
And copy down to match.
HTH,
Bernie
MS Excel MVPquot;carlquot; gt; wrote in message
...
gt;I tried but cannot get a formula to give me the result.
gt;
gt; I am looking for a formula for ColH (Calc) that will do the following:
gt;
gt; If Name1 OR Name2 is Fred And Type is A, For Side=Sell (PriceB-Price), For
gt; Side=Buy (Price-PriceB)
gt;
gt; Name1 Name2 Side Type Price PriceA PriceB Calc
gt; Fred Blank Buy A 2 2 3 1
gt; Blank Fred Sell A 5 4 6 1
gt;
gt; Thank you in advance.
gt;
Thank you Bernie. If I change the logic slightly from:
If Name1 OR Name2 is Fred And Type is A, For Side=Sell (PriceB-Price), For
Side=Buy (Price-PriceB)
To:
If Name1 and Name3 OR Name2 is Fred And Type is A, For Side=Sell
(PriceB-Price), For Side=Buy (Price-PriceB)
How would the formula change.
Also. If the formula is False, can I make it return 0 quot;zeroquot; ?
Thank you again.
quot;Bernie Deitrickquot; wrote:
gt; In cell H2:
gt;
gt; =IF(AND(OR(A2=quot;Fredquot;,B2=quot;Fredquot;),D2=quot;Aquot;),IF(C2=quot;Sel lquot;,G2-E2,E2-G2),quot;quot;)
gt;
gt; And copy down to match.
gt;
gt; HTH,
gt; Bernie
gt; MS Excel MVP
gt;
gt;
gt; quot;carlquot; gt; wrote in message
gt; ...
gt; gt;I tried but cannot get a formula to give me the result.
gt; gt;
gt; gt; I am looking for a formula for ColH (Calc) that will do the following:
gt; gt;
gt; gt; If Name1 OR Name2 is Fred And Type is A, For Side=Sell (PriceB-Price), For
gt; gt; Side=Buy (Price-PriceB)
gt; gt;
gt; gt; Name1 Name2 Side Type Price PriceA PriceB Calc
gt; gt; Fred Blank Buy A 2 2 3 1
gt; gt; Blank Fred Sell A 5 4 6 1
gt; gt;
gt; gt; Thank you in advance.
gt; gt;
gt;
gt;
gt;
Assuming Name 3 is in column C, and everything in D:G shifts to the right, in cell I2, use
=IF(AND(OR(AND(A2=quot;Fredquot;,C2=quot;Fredquot;),B2=quot;Fredquot;),E2= quot;Aquot;),IF(D2=quot;Sellquot;,H2-F2,F2-H2),0)
HTH,
Bernie
MS Excel MVPquot;carlquot; gt; wrote in message
...
gt; Thank you Bernie. If I change the logic slightly from:
gt;
gt; If Name1 OR Name2 is Fred And Type is A, For Side=Sell (PriceB-Price), For
gt; Side=Buy (Price-PriceB)
gt;
gt; To:
gt;
gt; If Name1 and Name3 OR Name2 is Fred And Type is A, For Side=Sell
gt; (PriceB-Price), For Side=Buy (Price-PriceB)
gt;
gt; How would the formula change.
gt;
gt; Also. If the formula is False, can I make it return 0 quot;zeroquot; ?
gt;
gt; Thank you again.
gt;
gt;
gt;
gt; quot;Bernie Deitrickquot; wrote:
gt;
gt;gt; In cell H2:
gt;gt;
gt;gt; =IF(AND(OR(A2=quot;Fredquot;,B2=quot;Fredquot;),D2=quot;Aquot;),IF(C2=quot;Sel lquot;,G2-E2,E2-G2),quot;quot;)
gt;gt;
gt;gt; And copy down to match.
gt;gt;
gt;gt; HTH,
gt;gt; Bernie
gt;gt; MS Excel MVP
gt;gt;
gt;gt;
gt;gt; quot;carlquot; gt; wrote in message
gt;gt; ...
gt;gt; gt;I tried but cannot get a formula to give me the result.
gt;gt; gt;
gt;gt; gt; I am looking for a formula for ColH (Calc) that will do the following:
gt;gt; gt;
gt;gt; gt; If Name1 OR Name2 is Fred And Type is A, For Side=Sell (PriceB-Price), For
gt;gt; gt; Side=Buy (Price-PriceB)
gt;gt; gt;
gt;gt; gt; Name1 Name2 Side Type Price PriceA PriceB Calc
gt;gt; gt; Fred Blank Buy A 2 2 3 1
gt;gt; gt; Blank Fred Sell A 5 4 6 1
gt;gt; gt;
gt;gt; gt; Thank you in advance.
gt;gt; gt;
gt;gt;
gt;gt;
gt;gt;
- Dec 18 Mon 2006 20:34
If/AND/Or Formula Help
close
全站熱搜
留言列表
發表留言