Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 20
Default An Array Lookup Formula

We need to write array formulae that return all occurrances of a lookup value
in a lookup array instead of just the first occurrance. For example:

Col. A
Apples
Apples
Pears
Oranges
Apples
Oranges
Plums
Pears

Col. B
2 bushels
4 bushels
1 bushel
2 bushels
3 bushels
2 bushels
5 bushels
3 bushels

We want array formulae in columns D & E to pull all the pears and their
corresponding quantities:

Col. D
Pears
Pears

Col. E
1 bushel
3 bushels

Any suggestions??
Thanks in advance!
--
Susan
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 983
Default An Array Lookup Formula

Why not just filter on Pears?

"SueDot" wrote:

We need to write array formulae that return all occurrances of a lookup value
in a lookup array instead of just the first occurrance. For example:

Col. A
Apples
Apples
Pears
Oranges
Apples
Oranges
Plums
Pears

Col. B
2 bushels
4 bushels
1 bushel
2 bushels
3 bushels
2 bushels
5 bushels
3 bushels

We want array formulae in columns D & E to pull all the pears and their
corresponding quantities:

Col. D
Pears
Pears

Col. E
1 bushel
3 bushels

Any suggestions??
Thanks in advance!
--
Susan

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,560
Default An Array Lookup Formula

Hi,
Unless there is a reason not to sort on column A, I think Jim has athe right
idea. Is there a reason you can not sort this way, mayme the order of Colum A
is important and needs to be preserved?
Thanks,

"SueDot" wrote:

We need to write array formulae that return all occurrances of a lookup value
in a lookup array instead of just the first occurrance. For example:

Col. A
Apples
Apples
Pears
Oranges
Apples
Oranges
Plums
Pears

Col. B
2 bushels
4 bushels
1 bushel
2 bushels
3 bushels
2 bushels
5 bushels
3 bushels

We want array formulae in columns D & E to pull all the pears and their
corresponding quantities:

Col. D
Pears
Pears

Col. E
1 bushel
3 bushels

Any suggestions??
Thanks in advance!
--
Susan

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 20
Default An Array Lookup Formula

Ordinarily, filtering would work fine for a manual process. We are trying to
select multiple data sets from the same list data and return the answers to
multiple locations, in an automated fashion. Also, the sheet on which the
data list resides includes multiple combo boxes that get messed up after a
filter is run, so we need another solution aside from "auto filter" to
extract the necessary data.

"Jim Thomlinson" wrote:

Why not just filter on Pears?

"SueDot" wrote:

We need to write array formulae that return all occurrances of a lookup value
in a lookup array instead of just the first occurrance. For example:

Col. A
Apples
Apples
Pears
Oranges
Apples
Oranges
Plums
Pears

Col. B
2 bushels
4 bushels
1 bushel
2 bushels
3 bushels
2 bushels
5 bushels
3 bushels

We want array formulae in columns D & E to pull all the pears and their
corresponding quantities:

Col. D
Pears
Pears

Col. E
1 bushel
3 bushels

Any suggestions??
Thanks in advance!
--
Susan

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,560
Default An Array Lookup Formula

Hi,
This creates a copy of the sheet and sorts it on Col A, so it does not
disturbe your original data. Hope it helps.

Sub Macro1()
Range("A1").Select
Selection.CurrentRegion.Select
ThisSheet = ActiveSheet.Name
Sheets(ThisSheet).Select
Sheets(ThisSheet).Copy Befo=Sheets(1)
Selection.Sort Key1:=Range("A1"), Order1:=xlAscending, Header:=xlGuess, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _
DataOption1:=xlSortNormal
End Sub

Thanks,


"SueDot" wrote:

Ordinarily, filtering would work fine for a manual process. We are trying to
select multiple data sets from the same list data and return the answers to
multiple locations, in an automated fashion. Also, the sheet on which the
data list resides includes multiple combo boxes that get messed up after a
filter is run, so we need another solution aside from "auto filter" to
extract the necessary data.

"Jim Thomlinson" wrote:

Why not just filter on Pears?

"SueDot" wrote:

We need to write array formulae that return all occurrances of a lookup value
in a lookup array instead of just the first occurrance. For example:

Col. A
Apples
Apples
Pears
Oranges
Apples
Oranges
Plums
Pears

Col. B
2 bushels
4 bushels
1 bushel
2 bushels
3 bushels
2 bushels
5 bushels
3 bushels

We want array formulae in columns D & E to pull all the pears and their
corresponding quantities:

Col. D
Pears
Pears

Col. E
1 bushel
3 bushels

Any suggestions??
Thanks in advance!
--
Susan

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
i need help with a lookup and/or array type formula RlzGain Excel Worksheet Functions 1 March 6th 06 07:47 PM
Array formula combined with Lookup Kevin Gallagher Excel Discussion (Misc queries) 9 March 2nd 06 06:47 AM
Array formula lookup CJ-22 Excel Worksheet Functions 6 February 8th 06 05:45 PM
Lookup Array Formula aldsv Excel Worksheet Functions 4 October 25th 05 01:45 PM
Two-Way Lookup Array Formula Sam via OfficeKB.com Excel Worksheet Functions 2 February 5th 05 09:33 PM


All times are GMT +1. The time now is 03:35 AM.

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

About Us

"It's about Microsoft Excel"