Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
carl
 
Posts: n/a
Default If/AND/Or Formula Help

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)

Name1 Name2 Side Type Price PriceA PriceB Calc
Fred Blank Buy A 2 2 3 1
Blank Fred Sell A 5 4 6 1

Thank you in advance.

  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Bernie Deitrick
 
Posts: n/a
Default If/AND/Or Formula Help

In cell H2:

=IF(AND(OR(A2="Fred",B2="Fred"),D2="A"),IF(C2="Sel l",G2-E2,E2-G2),"")

And copy down to match.

HTH,
Bernie
MS Excel MVP


"carl" wrote in message
...
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)

Name1 Name2 Side Type Price PriceA PriceB Calc
Fred Blank Buy A 2 2 3 1
Blank Fred Sell A 5 4 6 1

Thank you in advance.



  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
carl
 
Posts: n/a
Default If/AND/Or Formula Help

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 "zero" ?

Thank you again.



"Bernie Deitrick" wrote:

In cell H2:

=IF(AND(OR(A2="Fred",B2="Fred"),D2="A"),IF(C2="Sel l",G2-E2,E2-G2),"")

And copy down to match.

HTH,
Bernie
MS Excel MVP


"carl" wrote in message
...
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)

Name1 Name2 Side Type Price PriceA PriceB Calc
Fred Blank Buy A 2 2 3 1
Blank Fred Sell A 5 4 6 1

Thank you in advance.




  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Bernie Deitrick
 
Posts: n/a
Default If/AND/Or Formula Help

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="Fred",C2="Fred"),B2="Fred"),E2= "A"),IF(D2="Sell",H2-F2,F2-H2),0)

HTH,
Bernie
MS Excel MVP


"carl" wrote in message
...
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 "zero" ?

Thank you again.



"Bernie Deitrick" wrote:

In cell H2:

=IF(AND(OR(A2="Fred",B2="Fred"),D2="A"),IF(C2="Sel l",G2-E2,E2-G2),"")

And copy down to match.

HTH,
Bernie
MS Excel MVP


"carl" wrote in message
...
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)

Name1 Name2 Side Type Price PriceA PriceB Calc
Fred Blank Buy A 2 2 3 1
Blank Fred Sell A 5 4 6 1

Thank you in advance.






  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
kraljb
 
Posts: n/a
Default If/AND/Or Formula Help


=if(and(or(a1="fred",b1="fred"),d1="a"),if(c1="buy ",e1-g1,g1-e1))


--
kraljb
------------------------------------------------------------------------
kraljb's Profile: http://www.excelforum.com/member.php...fo&userid=9955
View this thread: http://www.excelforum.com/showthread...hreadid=523627



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 02:23 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"