English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

In excell: I have a series of numbers... that wont change
I want to see if these numbers are in various cells.
example:
1,5,8 I want to see if any of these are in cells A1 thru G1

Would I do lookup or what?

I simplified the question to get the ghist problem figured out?

2006-09-09 09:03:54 · 1 answers · asked by pcreamer2000 5 in Computers & Internet Programming & Design

The source numbers to look for may change though rarely...
The numbers being looked at would be changing daily.

Example:
Source: 12,5,6 might rarely change
Targets: Daily change potential.
would chk a series of cells for the above source #'s

I was figuring VBA I was hoping to not go that route but no big deal.

2006-09-09 14:31:29 · update #1

Im betting vba is gonna be the way.
the source search #'s though rare need to be able to be changed (as rare they might end up being).

2006-09-09 14:32:45 · update #2

Im currnetly trying to figue easy just finding one number, and maybe loop the chk?

2006-09-10 03:48:43 · update #3

1 answers

If this is a static situation (i.e. You will always need to know whether the search values were found, and the search values never change) - then I would suggest a Conditional Formatting solution.

If this is a dynamic situation (i.e. You need answers from time to time, and the search values may change from time to time), I would suggestion a VBA macro.

Please elaborate on these two suggested solutions, if you need further help.

------------------------------------------------------------
Addition:
Sorry it took so long, I was in the process of installing Office 2007 Beta 2.

Okay, here's your VBA solution:
' //
' // Start Code
' //
Sub pcreamer2000()
For Each szCell In Selection
If szCell.Value = 1 Or _
szCell.Value = 5 Or _
szCell.Value = 8 Then
szCell.Interior.ColorIndex = 3
End If
Next szCell
End Sub
' //
' // End Code
' //

Check it and do not forget to reward my time with a Best Answer :)

2006-09-09 12:56:27 · answer #1 · answered by f 3 · 2 0

Using the method I describe here, you need one cell for each number to look for in the list.

This is the formula for checking for 12:

="12 " & NOT(ISNA(MATCH(12,A1:G1,0)))

This displays "12 " as a prefix
NOT() is used because checking for NA returns the opposite of what we want
ISNA() checks for a #N/A result from MATCH()
MATCH() looks for the number in the range A1:G1
the ,0 part tells it to look in the whole list regardless of the order of the numbers.

You will see in the cell either 12 TRUE or 12 FALSE.

For the 5 and the 6 number, use a different cell and change the 12 to the 5 and/or 6.

2006-09-10 12:44:28 · answer #2 · answered by Ken C. 6 · 0 0

fedest.com, questions and answers