ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Read list of cells; conditional (https://www.excelbanter.com/excel-discussion-misc-queries/68744-read-list-cells%3B-conditional.html)

asianmike

Read list of cells; conditional
 

I'm trying to find a way to read a list of cells and if the value in the
cell equals a specific value then print out something if not than skip
that element and go to the next one. Clarification: only print out
element that fit a certain conditional. I do not want a lot of bunch of
"false" cells or blank cells and I don't want to use just a filter. If a
macro is involved please be gentle as I know very little about macros.


--
asianmike
------------------------------------------------------------------------
asianmike's Profile: http://www.excelforum.com/member.php...o&userid=30973
View this thread: http://www.excelforum.com/showthread...hreadid=507220


Max

Read list of cells; conditional
 
"asianmike" wrote:
I'm trying to find a way to read a list of cells and if the value in the
cell equals a specific value then print out something if not than skip
that element and go to the next one. Clarification: only print out
element that fit a certain conditional. I do not want a lot of bunch of
"false" cells or blank cells and I don't want to use just a filter. If a
macro is involved please be gentle as I know very little about macros.


Here's a simple example using non-array formulas ..

Assume the source data below is in A1:B10,
and we want to extract only the text within col B
for which col A = 2 (say), in the same order that these appear in col B

2 Text1
1 Text2
2 Text3
1 Text4
2 Text5
2 Text6
3 Text7
3 Text8
1 Text9
3 Text10

Put in C1:
=IF(ISERROR(SMALL(D:D,ROW(A1))),"",
INDEX(B:B,MATCH(SMALL(D:D,ROW(A1)),D:D,0)))

Put in D1:
=IF(A1="","",IF(A1=2,ROW(),""))
(this is the criteria part)

Select C1:D1, copy down to D10

Col C will return the required results, all neatly bunched
at the top, w/o any intervening blank rows, viz.:

Text1
Text3
Text5
Text6

(Col D is the criteria col)
--
Max
Singapore
http://savefile.com/projects/236895
xdemechanik
---



Max

Read list of cells; conditional
 
A sample construct is available at:
http://www.savefile.com/files/2964920
Read List of Cells n Conditionally Print_asianmike_misc.xls
--
Max
Singapore
http://savefile.com/projects/236895
xdemechanik
---




All times are GMT +1. The time now is 08:37 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com