#1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 10
Default array match

This really has me stumped. Any help will be appreciated.

My data (partial):

col a col b col c
315 91 permit reqd
50 168 license reqd
91 172 regulatory reqd

notes: col a is a 15 row by 1 col range on sheet1 named "section" and will
not always be in ascending order, col b and col c are on sheet2. col b/col c
is a 13 row by 2 col range named "permit".

what I want to do: in cell sheet1!d5 put a formula that will return from the
permit range "permit reqd" IF 91 is entered or "license reqd" if 168 is
entered etc in the col a range, otherwise cell d5 would be blank.

For now, the numbers in col a and col b are entered as text. If that is an
issue, I can change them to numeric.

That leads to another question...

In researching this, and specifically using MATCH in an array formula, I've
noticed the syntax for an array formula using MATCH:
=MATCH(1,(condition1)*(condition2),0). What is the significance of the "1"
after the opening parenthesis?

TIA
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,718
Default array match

If "condition1" is TRUE, and "condition2" is TRUE
TRUE*TRUE=1

=MATCH(1,(TRUE)*(TRUE),0)

simplify
=MATCH(1,1,0)



"Mike S" wrote:

This really has me stumped. Any help will be appreciated.

My data (partial):

col a col b col c
315 91 permit reqd
50 168 license reqd
91 172 regulatory reqd

notes: col a is a 15 row by 1 col range on sheet1 named "section" and will
not always be in ascending order, col b and col c are on sheet2. col b/col c
is a 13 row by 2 col range named "permit".

what I want to do: in cell sheet1!d5 put a formula that will return from the
permit range "permit reqd" IF 91 is entered or "license reqd" if 168 is
entered etc in the col a range, otherwise cell d5 would be blank.

For now, the numbers in col a and col b are entered as text. If that is an
issue, I can change them to numeric.

That leads to another question...

In researching this, and specifically using MATCH in an array formula, I've
noticed the syntax for an array formula using MATCH:
=MATCH(1,(condition1)*(condition2),0). What is the significance of the "1"
after the opening parenthesis?

TIA

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Max Max is offline
external usenet poster
 
Posts: 9,221
Default array match

From my reading, this should suffice & work for you ..

In Sheet1,
Assuming lookup numbers (91, 172, 168, etc) will be input as text numbers in
A1 down, place in B1:
=IF(A1="","",IF(ISNA(VLOOKUP(A1+0,permit,2,0)),"", VLOOKUP(A1+0,permit,2,0)))
Copy down as far as required

=MATCH(1,(condition1)*(condition2),0).
What is the significance of the "1" after the opening parenthesis?


(condition1)*(condition2) will return an array of 1's/0's, eg: {0,0,1,0,1,0}
depending on whether both conditions are satisfied or not.

The "1" is the lookup value to exact match with the first "1" within the
array. MATCH will then return the position within the array.

For the example array: =MATCH(1,(condition1)*(condition2),0)
resolves to: = MATCH(1,{0,0,1,0,1,0},0)
and then to: 3
since the "1" finds an exact match in position 3 within the array:
{0,0,1,0,1,0}
--
Max
Singapore
http://savefile.com/projects/236895
xdemechanik
---
"Mike S" wrote:
This really has me stumped. Any help will be appreciated.

My data (partial):

col a col b col c
315 91 permit reqd
50 168 license reqd
91 172 regulatory reqd

notes: col a is a 15 row by 1 col range on sheet1 named "section" and will
not always be in ascending order, col b and col c are on sheet2. col b/col c
is a 13 row by 2 col range named "permit".

what I want to do: in cell sheet1!d5 put a formula that will return from the
permit range "permit reqd" IF 91 is entered or "license reqd" if 168 is
entered etc in the col a range, otherwise cell d5 would be blank.

For now, the numbers in col a and col b are entered as text. If that is an
issue, I can change them to numeric.

That leads to another question...

In researching this, and specifically using MATCH in an array formula, I've
noticed the syntax for an array formula using MATCH:
=MATCH(1,(condition1)*(condition2),0). What is the significance of the "1"
after the opening parenthesis?

TIA

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 10
Default array match

Thanks for your quick reply Max, but that's not quite what I need. I'm
looking for a single formula to put in cell d5 that will return the 2nd
column value in "permit" if one of the values in the first column of "permit"
is entered in "section". For now, let's assume only one of the values in the
first column of "permit" will be entered in "section".

I guess it's going to take, maybe, a combo array formula using index/match...



"Max" wrote:

From my reading, this should suffice & work for you ..

In Sheet1,
Assuming lookup numbers (91, 172, 168, etc) will be input as text numbers in
A1 down, place in B1:
=IF(A1="","",IF(ISNA(VLOOKUP(A1+0,permit,2,0)),"", VLOOKUP(A1+0,permit,2,0)))
Copy down as far as required

=MATCH(1,(condition1)*(condition2),0).
What is the significance of the "1" after the opening parenthesis?


(condition1)*(condition2) will return an array of 1's/0's, eg: {0,0,1,0,1,0}
depending on whether both conditions are satisfied or not.

The "1" is the lookup value to exact match with the first "1" within the
array. MATCH will then return the position within the array.

For the example array: =MATCH(1,(condition1)*(condition2),0)
resolves to: = MATCH(1,{0,0,1,0,1,0},0)
and then to: 3
since the "1" finds an exact match in position 3 within the array:
{0,0,1,0,1,0}
--
Max
Singapore
http://savefile.com/projects/236895
xdemechanik
---
"Mike S" wrote:
This really has me stumped. Any help will be appreciated.

My data (partial):

col a col b col c
315 91 permit reqd
50 168 license reqd
91 172 regulatory reqd

notes: col a is a 15 row by 1 col range on sheet1 named "section" and will
not always be in ascending order, col b and col c are on sheet2. col b/col c
is a 13 row by 2 col range named "permit".

what I want to do: in cell sheet1!d5 put a formula that will return from the
permit range "permit reqd" IF 91 is entered or "license reqd" if 168 is
entered etc in the col a range, otherwise cell d5 would be blank.

For now, the numbers in col a and col b are entered as text. If that is an
issue, I can change them to numeric.

That leads to another question...

In researching this, and specifically using MATCH in an array formula, I've
noticed the syntax for an array formula using MATCH:
=MATCH(1,(condition1)*(condition2),0). What is the significance of the "1"
after the opening parenthesis?

TIA

  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Max Max is offline
external usenet poster
 
Posts: 9,221
Default array match

Try in D5, array-entered (press CTRL+SHIFT+ENTER):
=IF(ISNA(MATCH(TRUE,ISNUMBER(MATCH(INDEX(permit,,1 ),section,0)),0)),"",INDEX(permit,MATCH(TRUE,ISNUM BER(MATCH(INDEX(permit,,1),section,0)),0),2))
--
Max
Singapore
http://savefile.com/projects/236895
xdemechanik
---
"Mike S" wrote:
Thanks for your quick reply Max, but that's not quite what I need. I'm
looking for a single formula to put in cell d5 that will return the 2nd
column value in "permit" if one of the values in the first column of "permit"
is entered in "section". For now, let's assume only one of the values in the
first column of "permit" will be entered in "section".

I guess it's going to take, maybe, a combo array formula using index/match...



  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 10
Default array match

Fantastic!!! Worked perfectly. Thank you Max.

"Max" wrote:

Try in D5, array-entered (press CTRL+SHIFT+ENTER):
=IF(ISNA(MATCH(TRUE,ISNUMBER(MATCH(INDEX(permit,,1 ),section,0)),0)),"",INDEX(permit,MATCH(TRUE,ISNUM BER(MATCH(INDEX(permit,,1),section,0)),0),2))
--
Max
Singapore
http://savefile.com/projects/236895
xdemechanik
---
"Mike S" wrote:
Thanks for your quick reply Max, but that's not quite what I need. I'm
looking for a single formula to put in cell d5 that will return the 2nd
column value in "permit" if one of the values in the first column of "permit"
is entered in "section". For now, let's assume only one of the values in the
first column of "permit" will be entered in "section".

I guess it's going to take, maybe, a combo array formula using index/match...

  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Max Max is offline
external usenet poster
 
Posts: 9,221
Default array match

Good to hear that, Mike !
You're welcome.
--
Max
Singapore
http://savefile.com/projects/236895
xdemechanik
---
"Mike S" wrote in message
...
Fantastic!!! Worked perfectly. Thank you Max.



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
index match array function-returning only first match, need last. Julie Olsen Excel Worksheet Functions 3 December 29th 06 12:50 AM
match, lookup or array? edluver Excel Worksheet Functions 0 October 21st 06 07:46 PM
1:1 as the Array using the MATCH function Knot2Brite New Users to Excel 4 July 8th 06 10:31 AM
Match as well as does not match array function Vikram Dhemare Excel Discussion (Misc queries) 7 April 25th 06 09:15 AM
Array sum for negative match Gooseman Excel Worksheet Functions 3 April 2nd 06 11:01 PM


All times are GMT +1. The time now is 04:56 PM.

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"