Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1,670
Default How to select item without using advanced filter?

Does anyone have any suggestions on how to select item based on following
conditions?
Under column F, there is a list of numbers.
Under column G, there is a list of types.
For example
1 Car
2 Orange
3 Car
4 Water
5 Orange
6 Car

I would like to select all the number with the type - Car under column H.
I try following code without luck
=INDEX(F:F,MATCH("Car",G:G,0)), I would like to select the
Small(number,row()) based on rows. Such as
In cell H1, it should return 1
In cell H2, it should return 3
In cell H3, it should return 6

Does anyone have any suggestions?
Thanks in advance for any suggestions
Eric
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 15,768
Default How to select item without using advanced filter?

Try this array formula** :

Assuming you enter this formula in cell A1...

=IF(ROWS(A$1:A1)<=COUNTIF(G$1:G$6,"car"),SMALL(IF( G$1:G$6="car",F$1:F$6),ROWS(A$1:A1)),"")

** array formulas need to be entered using the key combination of
CTRL,SHIFT,ENTER (not just ENTER)


--
Biff
Microsoft Excel MVP


"Eric" wrote in message
...
Does anyone have any suggestions on how to select item based on following
conditions?
Under column F, there is a list of numbers.
Under column G, there is a list of types.
For example
1 Car
2 Orange
3 Car
4 Water
5 Orange
6 Car

I would like to select all the number with the type - Car under column H.
I try following code without luck
=INDEX(F:F,MATCH("Car",G:G,0)), I would like to select the
Small(number,row()) based on rows. Such as
In cell H1, it should return 1
In cell H2, it should return 3
In cell H3, it should return 6

Does anyone have any suggestions?
Thanks in advance for any suggestions
Eric



  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 15,768
Default How to select item without using advanced filter?

I'm having one of those days where nothing I do is right!

I forgot to say:

Copy the formula down until you get blanks.


--
Biff
Microsoft Excel MVP


"T. Valko" wrote in message
...
Try this array formula** :

Assuming you enter this formula in cell A1...

=IF(ROWS(A$1:A1)<=COUNTIF(G$1:G$6,"car"),SMALL(IF( G$1:G$6="car",F$1:F$6),ROWS(A$1:A1)),"")

** array formulas need to be entered using the key combination of
CTRL,SHIFT,ENTER (not just ENTER)


--
Biff
Microsoft Excel MVP


"Eric" wrote in message
...
Does anyone have any suggestions on how to select item based on following
conditions?
Under column F, there is a list of numbers.
Under column G, there is a list of types.
For example
1 Car
2 Orange
3 Car
4 Water
5 Orange
6 Car

I would like to select all the number with the type - Car under column H.
I try following code without luck
=INDEX(F:F,MATCH("Car",G:G,0)), I would like to select the
Small(number,row()) based on rows. Such as
In cell H1, it should return 1
In cell H2, it should return 3
In cell H3, it should return 6

Does anyone have any suggestions?
Thanks in advance for any suggestions
Eric





  #4   Report Post  
Posted to microsoft.public.excel.misc
Max Max is offline
external usenet poster
 
Posts: 9,221
Default How to select item without using advanced filter?

An alternative, non-array set-up
Data assumed in cols F and G, from row 2 down
You can input the selection fro col G in H1, eg in H1: Car

In H2:
=IF(H$1="","",IF(G2=H$1,ROW(),""))

In I2:
=IF(ROWS($1:1)COUNT(H:H),"",INDEX(F:F,SMALL(H:H,R OWS($1:1))))
Select H2:I2, copy down as far as required to cover the max expected extent
of data. Col I will return the required results from col F for the selection
entered in H1, all neatly bunched at the top.
--
Max
Singapore
http://savefile.com/projects/236895
xdemechanik
---
"Eric" wrote:
Does anyone have any suggestions on how to select item based on following
conditions?
Under column F, there is a list of numbers.
Under column G, there is a list of types.
For example
1 Car
2 Orange
3 Car
4 Water
5 Orange
6 Car

I would like to select all the number with the type - Car under column H.
I try following code without luck
=INDEX(F:F,MATCH("Car",G:G,0)), I would like to select the
Small(number,row()) based on rows. Such as
In cell H1, it should return 1
In cell H2, it should return 3
In cell H3, it should return 6

Does anyone have any suggestions?
Thanks in advance for any suggestions
Eric

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
Question with use of advanced filter to select empty cells RAJ Excel Discussion (Misc queries) 5 March 1st 07 03:11 PM
Why won't advanced filter return filter results? jaws4518 Excel Worksheet Functions 5 September 12th 06 06:11 PM
How do I use advanced filter to filter for blank cells? Monique Excel Discussion (Misc queries) 2 March 21st 06 06:43 PM
"Criteria Range" in the "Data/Filter/Advanced Filter" to select Du TC Excel Worksheet Functions 1 May 12th 05 02:06 AM
advanced filter won't allow me to filter on bracketed text (-456.2 LucianoG Excel Discussion (Misc queries) 1 December 6th 04 08:38 PM


All times are GMT +1. The time now is 07:54 PM.

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"