PC Review


Reply
Thread Tools Rate Thread

Check arrays for value.

 
 
Robert Hatcher
Guest
Posts: n/a
 
      27th Sep 2011
I have several arrays of unique numbers (no array has any of the same
numbers). I would like to have a formula in a cell that checks for
the presense of a value in the arrays and returns the name of the
array containing the value. The input value is in an adjacent cell.
The arrays are all named.

Simplified version of the data:

Arrays;
FS = 1,2,3
AS = 4,5,6
AP = 7,8,9
FP = 10,11,12

If the input is 5 "AS" is returned

Thanks
Robert
 
Reply With Quote
 
 
 
 
Don Guillett
Guest
Posts: n/a
 
      27th Sep 2011
On Sep 27, 9:08*am, Robert Hatcher <rhatcher...@gmail.com> wrote:
> I have several arrays of unique numbers (no array has any of the same
> numbers). *I would like to have a formula in a cell that checks for
> the presense of a value in the arrays and returns the name of the
> array containing the value. The input value is in an adjacent cell.
> The arrays are all named.
>
> Simplified version of the data:
>
> Arrays;
> FS = 1,2,3
> AS = 4,5,6
> AP = 7,8,9
> FP = *10,11,12
>
> If the input is 5 "AS" is returned
>
> Thanks
> Robert

If AS in col A and number arrays in col b

Sub find5row()
For Each c In Range("b1:b21")
If InStr(c, 5) Then
MsgBox "5 found at row " & c.Row _
& " for " & Cells(c.Row, 1)
Exit For
End If
Next c
End Sub

 
Reply With Quote
 
Robert Hatcher
Guest
Posts: n/a
 
      28th Sep 2011

Thanks Don,
Because of It limitations on the site I need to do this without VBA.
Robert

On Sep 27, 6:48*pm, Don Guillett <dguille...@gmail.com> wrote:
> On Sep 27, 9:08*am, Robert Hatcher <rhatcher...@gmail.com> wrote:
>
>
>
> > I have several arrays of unique numbers (no array has any of the same
> > numbers). *I would like to have a formula in a cell that checks for
> > the presense of a value in the arrays and returns the name of the
> > array containing the value. The input value is in an adjacent cell.
> > The arrays are all named.

>
> > Simplified version of the data:

>
> > Arrays;
> > FS = 1,2,3
> > AS = 4,5,6
> > AP = 7,8,9
> > FP = *10,11,12

>
> > If the input is 5 "AS" is returned

>
> > Thanks
> > Robert

>
> If *AS in col A and number arrays in col b
>
> Sub find5row()
> For Each c In Range("b1:b21")
> If InStr(c, 5) Then
> MsgBox "5 found at row " & c.Row _
> & " for " & Cells(c.Row, 1)
> Exit For
> End If
> Next c
> End Sub- Hide quoted text -
>
> - Show quoted text -


 
Reply With Quote
 
Claus Busch
Guest
Posts: n/a
 
      28th Sep 2011
Hi Robert,

Am Wed, 28 Sep 2011 05:20:15 -0700 (PDT) schrieb Robert Hatcher:

> Because of It limitations on the site I need to do this without VBA.


names of arrays in col A, arrays in col B, input 5 in D1:
Array formula:
=INDEX(A:A,MATCH(TRUE,FIND(D1,$B$1:$B$100)>0,0))
enter with CTRL + Shift + Enter


Regards
Claus Busch
--
Win XP PRof SP2 / Vista Ultimate SP2
Office 2003 SP2 /2007 Ultimate SP2
 
Reply With Quote
 
Robert Hatcher
Guest
Posts: n/a
 
      28th Sep 2011
Thanks claus, I will try that.

On Sep 28, 8:50*am, Claus Busch <claus_bu...@t-online.de> wrote:
> Hi Robert,
>
> Am Wed, 28 Sep 2011 05:20:15 -0700 (PDT) schrieb Robert Hatcher:
>
> > Because of It limitations on the site I need to do this without VBA.

>
> names of arrays in col A, arrays in col B, input 5 in D1:
> Array formula:
> =INDEX(A:A,MATCH(TRUE,FIND(D1,$B$1:$B$100)>0,0))
> enter with CTRL + Shift + Enter
>
> Regards
> Claus Busch
> --
> Win XP PRof SP2 / Vista Ultimate SP2
> Office 2003 SP2 /2007 Ultimate SP2


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Converting native arrays to managed arrays Bob Altman Microsoft VC .NET 8 27th Feb 2008 11:33 PM
Trouble with arrays (transferring values between two arrays) Keith R Microsoft Excel Programming 4 14th Nov 2007 12:00 AM
Jagged Arrays Problem - How to Assign Arrays to an Array Zigs Microsoft Excel Programming 3 11th Apr 2007 01:39 AM
Working with ranges in arrays... or an introduction to arrays =?Utf-8?B?R2xlbg==?= Microsoft Excel Programming 5 10th Sep 2006 08:32 AM
Arrays - declaration, adding values to arrays and calculation Maxi Microsoft Excel Programming 1 17th Aug 2006 04:13 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 08:42 PM.