Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 5
Default Is this possible? If so what function do I use?

My data is:
A B C
TX United States
MA
NY United States
NJ
NH United States
London United Kingdom
Paris France


Column A has states that are almost always populated, but B is often left
blank. I wanted to create some type of Array or Lookup that has all the
states in it, and them do a comparison; If what is in Column A is a valid
state, then populate B with "United States, otherwise leave it alone.

I can't use "IF" because there are too many arguments, and can't figure out
how to make it work with something like VLOOKUP.

Advice apreciated.
~S
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,501
Default Is this possible? If so what function do I use?

Put a list of valid states somewhere, in this case H1 - H50 then try this
formula:-


=IF(COUNTIF($H$1:$H$50,A1)0,"United States","")

drag down as required

Mike

This looks

"AdirondackSam" wrote:

My data is:
A B C
TX United States
MA
NY United States
NJ
NH United States
London United Kingdom
Paris France


Column A has states that are almost always populated, but B is often left
blank. I wanted to create some type of Array or Lookup that has all the
states in it, and them do a comparison; If what is in Column A is a valid
state, then populate B with "United States, otherwise leave it alone.

I can't use "IF" because there are too many arguments, and can't figure out
how to make it work with something like VLOOKUP.

Advice apreciated.
~S

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 15,768
Default Is this possible? If so what function do I use?

Create a 1 column table of all 50 states. Assume this table is in the range
D1:D50.

Then, in column B:

=IF(COUNTIF(D$1:D$50,A1),"United States","")

Copy down as needed.

--
Biff
Microsoft Excel MVP


"AdirondackSam" wrote in message
...
My data is:
A B C
TX United States
MA
NY United States
NJ
NH United States
London United Kingdom
Paris France


Column A has states that are almost always populated, but B is often left
blank. I wanted to create some type of Array or Lookup that has all the
states in it, and them do a comparison; If what is in Column A is a valid
state, then populate B with "United States, otherwise leave it alone.

I can't use "IF" because there are too many arguments, and can't figure
out
how to make it work with something like VLOOKUP.

Advice apreciated.
~S



  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 4,393
Default Is this possible? If so what function do I use?

Great list available he
http://www.usps.com/ncsc/lookups/abbr_state.txt

--
Bernard V Liengme
Microsoft Excel MVP
www.stfx.ca/people/bliengme
remove caps from email

"T. Valko" wrote in message
...
Create a 1 column table of all 50 states. Assume this table is in the
range D1:D50.

Then, in column B:

=IF(COUNTIF(D$1:D$50,A1),"United States","")

Copy down as needed.

--
Biff
Microsoft Excel MVP


"AdirondackSam" wrote in message
...
My data is:
A B C
TX United States
MA
NY United States
NJ
NH United States
London United Kingdom
Paris France


Column A has states that are almost always populated, but B is often left
blank. I wanted to create some type of Array or Lookup that has all the
states in it, and them do a comparison; If what is in Column A is a
valid
state, then populate B with "United States, otherwise leave it alone.

I can't use "IF" because there are too many arguments, and can't figure
out
how to make it work with something like VLOOKUP.

Advice apreciated.
~S





  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,480
Default Is this possible? If so what function do I use?

Hi

One way
Create a list of the States in say column A of Sheet2 then use
=IF(ISNUMBER(MATCH(A2,Sheet2!A:A)),"United States","Other")

--
Regards
Roger Govier



"AdirondackSam" wrote in message
...
My data is:
A B C
TX United States
MA
NY United States
NJ
NH United States
London United Kingdom
Paris France


Column A has states that are almost always populated, but B is often left
blank. I wanted to create some type of Array or Lookup that has all the
states in it, and them do a comparison; If what is in Column A is a valid
state, then populate B with "United States, otherwise leave it alone.

I can't use "IF" because there are too many arguments, and can't figure
out
how to make it work with something like VLOOKUP.

Advice apreciated.
~S





  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 5
Default Is this possible? If so what function do I use?

Thanks all - suggestions were spot on and I was able to do what I wanted.


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
copy of excel file not showing formulal/function in the function b oaallam Excel Discussion (Misc queries) 4 September 6th 07 01:20 PM
LINKEDRANGE function - a complement to the PULL function (for getting values from a closed workbook) [email protected] Excel Worksheet Functions 0 September 5th 06 03:44 PM
Offset function with nested match function not finding host ss. MKunert Excel Worksheet Functions 1 March 21st 06 10:46 PM
Emulate Index/Match combo function w/ VBA custom function Spencer Hutton Excel Worksheet Functions 2 May 2nd 05 05:26 PM
Nested IF Function, Date Comparing, and NetworkDays Function carl Excel Worksheet Functions 2 December 29th 04 09:57 PM


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

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"