Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Junior Member
 
Posts: 4
Default Help with a Formula to turn various words into numbers

Hello ExcelBanter Experts,

I'm soliciting help for a project. I have a column row with city names in them, I'd like to write a conditional formula that will convert those names into several different numeric values that we can use to evaluate them. problem is I have a LOT of cities and I need a great big formula to do. Any thoughts on how I can set this up?? I'm using Excel 2007. Thanks in advance.
  #2   Report Post  
Senior Member
 
Posts: 663
Default

Quote:
Originally Posted by College_Guru View Post
Hello ExcelBanter Experts,

I'm soliciting help for a project. I have a column row with city names in them, I'd like to write a conditional formula that will convert those names into several different numeric values that we can use to evaluate them. problem is I have a LOT of cities and I need a great big formula to do. Any thoughts on how I can set this up?? I'm using Excel 2007. Thanks in advance.
Can you provide an example of some data and an explanation of how you assign any given numeric value to a specific city?
  #3   Report Post  
Junior Member
 
Posts: 4
Default

Quote:
Originally Posted by Spencer101 View Post
Can you provide an example of some data and an explanation of how you assign any given numeric value to a specific city?
Basically we have a column of cities EX.
Seattle
Atlanta
San Francisco
Everett
Portland

What I want to do is have another column display a corresponding numeric value for that city. These values will correspond to geographic territories for our systems. Ex. Seattle = 1, Atlanta=3 and so forth.
  #4   Report Post  
Senior Member
 
Posts: 663
Default

Quote:
Originally Posted by College_Guru View Post
Basically we have a column of cities EX.
Seattle
Atlanta
San Francisco
Everett
Portland

What I want to do is have another column display a corresponding numeric value for that city. These values will correspond to geographic territories for our systems. Ex. Seattle = 1, Atlanta=3 and so forth.
You're still not explaining particularly well what you're after.

Let me ask it this way, WHY does Seattle =1 and Atlanta = 3 etc.??
Are there set rules to each city/number combination?
Do you have a table with each city and number and you just want to look up the relevant one?
Are you just trying to assign a number to a city then move on to the next number when the city changes?

Without that information, nobody here can assist with your original query.
  #5   Report Post  
Junior Member
 
Posts: 4
Default

Quote:
Originally Posted by Spencer101 View Post
You're still not explaining particularly well what you're after.

Let me ask it this way, WHY does Seattle =1 and Atlanta = 3 etc.??
Are there set rules to each city/number combination?
Do you have a table with each city and number and you just want to look up the relevant one?
Are you just trying to assign a number to a city then move on to the next number when the city changes?

Without that information, nobody here can assist with your original query.
Okay, Seattle = 1 because that's the value we want to assign to that region. I need there to be 3 distinct groups of cities, so that when the query looks in the City field is generates the right number for that enrty.

For example. Seattle, Portland, and Centralia are all category 1 cities, San Francisco, Pullman, and Denver are all category 2. I need a formula that can distinguish what's being entered. I hope that helps.


  #6   Report Post  
Senior Member
 
Posts: 663
Default

Quote:
Originally Posted by College_Guru View Post
Okay, Seattle = 1 because that's the value we want to assign to that region. I need there to be 3 distinct groups of cities, so that when the query looks in the City field is generates the right number for that enrty.

For example. Seattle, Portland, and Centralia are all category 1 cities, San Francisco, Pullman, and Denver are all category 2. I need a formula that can distinguish what's being entered. I hope that helps.
If you know what the numeric value should be for each country then make a table with City Names in the first column and the relevant numbers in the second column.

Then use VLOOKUP to add the relevant numbers into your data.

If you need help with that, let me know.
  #7   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 427
Default Help with a Formula to turn various words into numbers

Rather than a conditional formula- by which I presume you mean an IF() formula- would a VLOOKUP() work instead? If you insert a column next to your city name, you could maintain a lookup table on a different tab. This would be much easier to maintain than a monstrously long IF() formula.
  #8   Report Post  
Junior Member
 
Posts: 4
Default

Quote:
Originally Posted by Dave O View Post
Rather than a conditional formula- by which I presume you mean an IF() formula- would a VLOOKUP() work instead? If you insert a column next to your city name, you could maintain a lookup table on a different tab. This would be much easier to maintain than a monstrously long IF() formula.
This could work, only problem is that when I looked VLookup in Excel it says the table must be in ascending order by default. Is this the reference table or the city column? If it's the city column then it won't do as our system automatically sorts entries by another field.
  #9   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 168
Default Help with a Formula to turn various words into numbers

On Wednesday, July 25, 2012 3:36:13 PM UTC-7, College_Guru wrote:
Hello ExcelBanter Experts,



I'm soliciting help for a project. I have a column row with city names

in them, I'd like to write a conditional formula that will convert those

names into several different numeric values that we can use to evaluate

them. problem is I have a LOT of cities and I need a great big formula

to do. Any thoughts on how I can set this up?? I'm using Excel 2007.

Thanks in advance.









--

College_Guru




On Wednesday, July 25, 2012 3:36:13 PM UTC-7, College_Guru wrote:
Hello ExcelBanter Experts,



I'm soliciting help for a project. I have a column row with city names

in them, I'd like to write a conditional formula that will convert those

names into several different numeric values that we can use to evaluate

them. problem is I have a LOT of cities and I need a great big formula

to do. Any thoughts on how I can set this up?? I'm using Excel 2007.

Thanks in advance.









--

College_Guru




On Wednesday, July 25, 2012 3:36:13 PM UTC-7, College_Guru wrote:
Hello ExcelBanter Experts,



I'm soliciting help for a project. I have a column row with city names

in them, I'd like to write a conditional formula that will convert those

names into several different numeric values that we can use to evaluate

them. problem is I have a LOT of cities and I need a great big formula

to do. Any thoughts on how I can set this up?? I'm using Excel 2007.

Thanks in advance.









--

College_Guru




On Wednesday, July 25, 2012 3:36:13 PM UTC-7, College_Guru wrote:
Hello ExcelBanter Experts,



I'm soliciting help for a project. I have a column row with city names

in them, I'd like to write a conditional formula that will convert those

names into several different numeric values that we can use to evaluate

them. problem is I have a LOT of cities and I need a great big formula

to do. Any thoughts on how I can set this up?? I'm using Excel 2007.

Thanks in advance.









--

College_Guru


  #10   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1,045
Default Help with a Formula to turn various words into numbers

On Tue, 31 Jul 2012 00:43:18 +0000, College_Guru wrote:

This could work, only problem is that when I looked VLookup in Excel it
says the table must be in ascending order by default.


You didn't read far enough. You need to set range_lookup to false:

....

If range_lookup is FALSE, the values in the first column of table_array do not need to be sorted.

If the range_lookup argument is FALSE, VLOOKUP will find only an exact match. If there are two or more values in the first column of table_array that match the lookup_value, the first value found is used. If an exact match is not found, the error value #N/A is returned.

....
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
Formula to Convert Numbers to Words Kiley Excel Discussion (Misc queries) 3 May 6th 10 10:07 PM
Can I use words and numbers in the same cell in a formula? CarJO129 Excel Discussion (Misc queries) 5 December 29th 09 06:28 PM
recognizing words as numbers...for a formula CONFUSED Excel Worksheet Functions 2 June 4th 09 02:27 AM
Turn numbers into words to automate check-writing TONY M Excel Discussion (Misc queries) 3 February 28th 07 08:31 PM
Turn numbers into words to automate check-writing Mike Excel Discussion (Misc queries) 0 February 28th 07 02:18 PM


All times are GMT +1. The time now is 01:34 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"