Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
ph2da00
 
Posts: n/a
Default conditional search


Hi everyone. I've run into a bit of a problem with one of my
worksheets. I have a column whose cells are either blank, "Buy" or
"Sell" I want the column next to it to put "***" in cells that are one

row up from a "Buy" and "xxx" in cells that are one up from a "Sell"
but I only want these to occur if below the "Buy" there is a "Sell"
ignoring the blank cells, and visa-versa for "xxx" when "Sell" is above

a "Buy" ignoring blank cells.


Thanks in advance for your help. I can elaborate if needed.


--
ph2da00
------------------------------------------------------------------------
ph2da00's Profile: http://www.excelforum.com/member.php...o&userid=28406
View this thread: http://www.excelforum.com/showthread...hreadid=479985

  #2   Report Post  
Stefi
 
Posts: n/a
Default conditional search

Say your column is A, next column is B. I used three helper columns C,D,E,
otherwise the formula would be unconveniantly long (you can hide them or you
can build a huge formula):

in B1: =IF(AND(A2="Buy";C2<D2);"***";IF(AND(A2="Sell";D2< C2);"xxx";""))
in C1:
=IF(ISERROR(MATCH("Sell";INDIRECT(E1);0));65536;MA TCH("Sell";INDIRECT(E1);0))
in D1: =IF(ISERROR(MATCH("Buy";INDIRECT(E1);0));0;MATCH(" Buy";INDIRECT(E1);0))
in E1: ="A" & CELL("row";A1)+1 & ":A65536"

and fill down as necessary!

Regards,
Stefi

€˛ph2da00€¯ ezt Ć*rta:


Hi everyone. I've run into a bit of a problem with one of my
worksheets. I have a column whose cells are either blank, "Buy" or
"Sell" I want the column next to it to put "***" in cells that are one

row up from a "Buy" and "xxx" in cells that are one up from a "Sell"
but I only want these to occur if below the "Buy" there is a "Sell"
ignoring the blank cells, and visa-versa for "xxx" when "Sell" is above

a "Buy" ignoring blank cells.


Thanks in advance for your help. I can elaborate if needed.


--
ph2da00
------------------------------------------------------------------------
ph2da00's Profile: http://www.excelforum.com/member.php...o&userid=28406
View this thread: http://www.excelforum.com/showthread...hreadid=479985


  #3   Report Post  
Stefi
 
Posts: n/a
Default conditional search

Sorry, I forgot to replace my semicolon list separators to commas:

in B1: =IF(AND(A2="Buy",C2<D2),"***",IF(AND(A2="Sell",D2< C2),"xxx",""))
in C1:
=IF(ISERROR(MATCH("Sell",INDIRECT(E1),0)),65536,MA TCH("Sell",INDIRECT(E1),0))
in D1: =IF(ISERROR(MATCH("Buy",INDIRECT(E1),0)),0,MATCH(" Buy",INDIRECT(E1),0))
in E1: ="A" & CELL("row",A1)+1 & ":A65536"

Stefi
€˛Stefi€¯ ezt Ć*rta:

Say your column is A, next column is B. I used three helper columns C,D,E,
otherwise the formula would be unconveniantly long (you can hide them or you
can build a huge formula):

in B1: =IF(AND(A2="Buy";C2<D2);"***";IF(AND(A2="Sell";D2< C2);"xxx";""))
in C1:
=IF(ISERROR(MATCH("Sell";INDIRECT(E1);0));65536;MA TCH("Sell";INDIRECT(E1);0))
in D1: =IF(ISERROR(MATCH("Buy";INDIRECT(E1);0));0;MATCH(" Buy";INDIRECT(E1);0))
in E1: ="A" & CELL("row";A1)+1 & ":A65536"

and fill down as necessary!

Regards,
Stefi

€˛ph2da00€¯ ezt Ć*rta:


Hi everyone. I've run into a bit of a problem with one of my
worksheets. I have a column whose cells are either blank, "Buy" or
"Sell" I want the column next to it to put "***" in cells that are one

row up from a "Buy" and "xxx" in cells that are one up from a "Sell"
but I only want these to occur if below the "Buy" there is a "Sell"
ignoring the blank cells, and visa-versa for "xxx" when "Sell" is above

a "Buy" ignoring blank cells.


Thanks in advance for your help. I can elaborate if needed.


--
ph2da00
------------------------------------------------------------------------
ph2da00's Profile: http://www.excelforum.com/member.php...o&userid=28406
View this thread: http://www.excelforum.com/showthread...hreadid=479985


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


Similar Threads
Thread Thread Starter Forum Replies Last Post
conditional search Nick Excel Worksheet Functions 0 October 27th 05 10:46 PM
Conditional formula - language needed gamebird Excel Worksheet Functions 7 October 10th 05 11:48 PM
FAQ Spreadsheet with search function murphyz Excel Discussion (Misc queries) 0 March 19th 05 09:24 PM
Conditional formatting not available in Excel BAB Excel Discussion (Misc queries) 2 January 1st 05 03:33 PM
Conditional Formula to search ranges?? adean Excel Discussion (Misc queries) 2 December 13th 04 10:53 PM


All times are GMT +1. The time now is 09:34 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"