Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
Operator
i have a spreadsheet where one column lists location codes. There are 20
different codes that are in the US. I want to create a formula that says if location code is one of these, it is equal to US. Thanks. |
#2
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
Operator
You can do a Vlookup, if the numbers that are in the us are in column A and
the number you are testing is in G then =IF(ISERROR(VLOOKUP(G1,A1:A31,1,FALSE)),"Other","U SA") or did you want to do this strictly through code? -- -John Northwest11 Please rate when your question is answered to help us and others know what is helpful. "kittycris" wrote: i have a spreadsheet where one column lists location codes. There are 20 different codes that are in the US. I want to create a formula that says if location code is one of these, it is equal to US. Thanks. |
#3
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
Operator
Thank you! How would I do this through code?
"John Bundy" wrote: You can do a Vlookup, if the numbers that are in the us are in column A and the number you are testing is in G then =IF(ISERROR(VLOOKUP(G1,A1:A31,1,FALSE)),"Other","U SA") or did you want to do this strictly through code? -- -John Northwest11 Please rate when your question is answered to help us and others know what is helpful. "kittycris" wrote: i have a spreadsheet where one column lists location codes. There are 20 different codes that are in the US. I want to create a formula that says if location code is one of these, it is equal to US. Thanks. |
#4
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
Operator
Thought I posted this earlier, ask questions if you need help
Sub main() Dim myArray(30, 1) As Long Dim myIndex As Long Dim myRow As Long Dim myNum As Long myNum = 4 For i = 1 To Cells(Rows.Count, "A").End(xlUp).Row 'change i to first 'row and "A" to first column myArray(i, 1) = Cells(i, 1) myRow = myRow + 1 Next For i = 1 To UBound(myArray) MsgBox myArray(i, 1) If myArray(i, 1) = myNum Then MsgBox "USA" Next End Sub -- -- -John Please rate when your question is answered to help us and others know what is helpful. "kittycris" wrote in message ... Thank you! How would I do this through code? "John Bundy" wrote: You can do a Vlookup, if the numbers that are in the us are in column A and the number you are testing is in G then =IF(ISERROR(VLOOKUP(G1,A1:A31,1,FALSE)),"Other","U SA") or did you want to do this strictly through code? -- -John Northwest11 Please rate when your question is answered to help us and others know what is helpful. "kittycris" wrote: i have a spreadsheet where one column lists location codes. There are 20 different codes that are in the US. I want to create a formula that says if location code is one of these, it is equal to US. Thanks. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Using Concatenate operator to overcome 7 nested IF's | Excel Worksheet Functions | |||
add one cell with no equals operator | Excel Discussion (Misc queries) | |||
corrupt program or file? How to tell? Or is it operator error? | Excel Discussion (Misc queries) | |||
SaveAS to a specific folder, with operator input of file name | Excel Discussion (Misc queries) | |||
"OR" operator to evaluate multiple conditions | Excel Worksheet Functions |