Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 22
Default Names with If function

I have created a drop down list of names. I am now trying to create an IF
function, that when a certain name is selected from the drop down box, it
will populate with a phone number. I receive the #NAME error. Can I not use
names with IF function?
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 15,768
Default Names with If function

If there are only a "few" selections available from your drop down list then
you can use an IF formula like this:

A1 = drop down list

=IF(A1="Biff","BR-549",IF(A1="Joe","555-1212",IF(A1="Linda","123-4567","")))

If you have more than a "few" selections available then your best bet is to
create a 2 column table like this:

.........AA.............AB......
1.....Biff..........BR-549
2.....Joe..........555-1212
3.....Linda......123-4567

Then use a lookup formula like this:

=VLOOKUP(A1,AA1:AB3,2,0)

The list of names in column AA can also be the source of your drop down
list.

--
Biff
Microsoft Excel MVP


"Dgwood90" wrote in message
...
I have created a drop down list of names. I am now trying to create an IF
function, that when a certain name is selected from the drop down box, it
will populate with a phone number. I receive the #NAME error. Can I not
use
names with IF function?



  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,942
Default Names with If function

hi
i think so. post your formula.

regards
FSt1

"Dgwood90" wrote:

I have created a drop down list of names. I am now trying to create an IF
function, that when a certain name is selected from the drop down box, it
will populate with a phone number. I receive the #NAME error. Can I not use
names with IF function?

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,118
Default Names with If function

If you constructed a list of Names and Phone Numbers (in that order) on
another sheet, you could use the Names in the Data Validation list and use a
VLOOKUP function to return the Phone Number for the selected name.

Here's an example:

On Sheet2
Cells A2:B10 contain a list of Names and Phone Numbers.
Assign a Range Name to that range
.. Select A2:B10
.. In the Name Box (just above the Col_A heading) type: NamesPhones
.. Press [ENTER]
.. Select A2:A10
.. In the Name Box (just above the Col_A heading) type: NameList
.. Press [ENTER]

On Sheet1
Create a Data Validation in Cell A2
.. Select A2
.. From the Excel Main Menu: <data<validation
....Allow: List
....Source: NameList
....Click the [OK] button

Select B2
.. Enter this formula in that cell: =IF(A2="","",VLOOKUP(A2,NamesPhones,2,0))

Is that something you can work with?
Post back if you have more questions.
--------------------------

Regards,

Ron
Microsoft MVP (Excel)
(XL2003, Win XP)



"Dgwood90" wrote in message
...
I have created a drop down list of names. I am now trying to create an IF
function, that when a certain name is selected from the drop down box, it
will populate with a phone number. I receive the #NAME error. Can I not
use
names with IF function?



  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 22
Default Names with If function

This is the formula I am using.
=IF(A10=Steve Smith,555-555-5555,IF(A10=John Adams,555-555-5555,"")). I am
using four names.

"FSt1" wrote:

hi
i think so. post your formula.

regards
FSt1

"Dgwood90" wrote:

I have created a drop down list of names. I am now trying to create an IF
function, that when a certain name is selected from the drop down box, it
will populate with a phone number. I receive the #NAME error. Can I not use
names with IF function?



  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,118
Default Names with If function

Try something like this (in sections for readability):

=IF(A10="","",INDEX({"555-1111","555-2222","555-3333","555-4444"},
MATCH(A10,{"Alpha","Bravo","Charlie","Delta"},0)))

Is that something you can work with?
--------------------------

Regards,

Ron
Microsoft MVP (Excel)
(XL2003, Win XP)

"Dgwood90" wrote in message
...
This is the formula I am using.
=IF(A10=Steve Smith,555-555-5555,IF(A10=John Adams,555-555-5555,"")). I
am
using four names.

"FSt1" wrote:

hi
i think so. post your formula.

regards
FSt1

"Dgwood90" wrote:

I have created a drop down list of names. I am now trying to create an
IF
function, that when a certain name is selected from the drop down box,
it
will populate with a phone number. I receive the #NAME error. Can I
not use
names with IF function?




  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,942
Default Names with If function

hi,
the only thing i see wrong with your formula is the names and phone numbers
are not enclosed in double quotes.
=IF(A10="Steve Smith","555-555-5555",IF(A10="John Adams","555-555-5555","")
text should always be enclosed in double quotes. and telephone number are
considered text. here is a formula i developed as a test.
=IF(B3="Bob",C4,IF(B3="cary",C5,IF(B3="jim",C6,IF( B3="lucy",C7,""))))
here i called the cell that had the phone number in it.
I used data validation for my drop down.

post back if you have problems.
regards
FSt1

"Dgwood90" wrote:

This is the formula I am using.
=IF(A10=Steve Smith,555-555-5555,IF(A10=John Adams,555-555-5555,"")). I am
using four names.

"FSt1" wrote:

hi
i think so. post your formula.

regards
FSt1

"Dgwood90" wrote:

I have created a drop down list of names. I am now trying to create an IF
function, that when a certain name is selected from the drop down box, it
will populate with a phone number. I receive the #NAME error. Can I not use
names with IF function?

  #8   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 22
Default Names with If function

I can give it a try. Thanks

"Ron Coderre" wrote:

Try something like this (in sections for readability):

=IF(A10="","",INDEX({"555-1111","555-2222","555-3333","555-4444"},
MATCH(A10,{"Alpha","Bravo","Charlie","Delta"},0)))

Is that something you can work with?
--------------------------

Regards,

Ron
Microsoft MVP (Excel)
(XL2003, Win XP)

"Dgwood90" wrote in message
...
This is the formula I am using.
=IF(A10=Steve Smith,555-555-5555,IF(A10=John Adams,555-555-5555,"")). I
am
using four names.

"FSt1" wrote:

hi
i think so. post your formula.

regards
FSt1

"Dgwood90" wrote:

I have created a drop down list of names. I am now trying to create an
IF
function, that when a certain name is selected from the drop down box,
it
will populate with a phone number. I receive the #NAME error. Can I
not use
names with IF function?





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
where to find translation of the names of the function natash@ Excel Discussion (Misc queries) 2 August 22nd 06 01:06 PM
Help with using range names in sum function soteman2005 Excel Worksheet Functions 2 November 28th 05 04:43 PM
Looking for function to pick out names and at values from the same row johnsvolition New Users to Excel 1 September 15th 05 03:39 AM
Translating function names dziw Excel Discussion (Misc queries) 2 June 30th 05 04:37 AM
Is there a function that allows me to list the names of excluded d Flutie99 Excel Worksheet Functions 1 June 1st 05 01:34 AM


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