Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
marjoryann
 
Posts: n/a
Default What function do I use to return a certain value for specific text

e.g. if 5-2100 is entered into A1 then A2 should automatically = $31.00, if
5-6100 is entered into A1 then A2 should automatically = $36.00.

  #2   Report Post  
Posted to microsoft.public.excel.misc
Gary''s Student
 
Posts: n/a
Default What function do I use to return a certain value for specific text

=(A1="5-2000")*31 + (A1="5-6100")*36
format as currency
--
Gary's Student


"marjoryann" wrote:

e.g. if 5-2100 is entered into A1 then A2 should automatically = $31.00, if
5-6100 is entered into A1 then A2 should automatically = $36.00.

  #3   Report Post  
Posted to microsoft.public.excel.misc
Bondi
 
Posts: n/a
Default What function do I use to return a certain value for specific text


marjoryann wrote:
e.g. if 5-2100 is entered into A1 then A2 should automatically = $31.00, if
5-6100 is entered into A1 then A2 should automatically = $36.00.


Hi,

Is there any connection between text and amount?

Regards,
Bondi

  #4   Report Post  
Posted to microsoft.public.excel.misc
 
Posts: n/a
Default What function do I use to return a certain value for specific text

"marjoryann" wrote:
e.g. if 5-2100 is entered into A1 then A2 should automatically = $31.00, if
5-6100 is entered into A1 then A2 should automatically = $36.00.


(Please learn to repeat you entire query in the body of the posting, not
just the subject line. Some news readers truncate the latter.)

If you have only the two choices (which I doubt is the case), perhaps the
most KISS solution is an if() function, e.g. one of the following, depending
on how bullet-proof you want to be:

=if(A1="5-2100", 31, 36)

=if(A1="5-2100", 31, if(a1="5-6100", 36, ""))

If you have many choices, one of the following might work well for you
(replace "..." with additional pairs of match strings and prices; note how
comma and semicolon are used):

=vlookup(a1, {"5-2100", 31; "5-6100", 36; ...}, 2, 0)

=vlookup(a1, m1:n100, 2, 0)

where m1:m100 is the column containing such match strings as 5-2100 and
5-6100, and n1:n100 is the adjacent column containing the corresponding
prices.

Some caveats about vlookup():

1. The match strings must be in sorted order. If you feel confident, sort
them manually. Otherwise, put the match strings into a column of cells, and
use Data Sort Ascending to put them in proper order for vlookup().

2. Unfortunately, vlookup() is not bullet-proof. If no match is found, an
error (#N/A) is returned :-(. To avoid that, you might write the vlookup()
twice, e.g:

=if(iserror(vlookup(...)), "", vlookup(...))
  #5   Report Post  
Posted to microsoft.public.excel.misc
marjoryann
 
Posts: n/a
Default What function do I use to return a certain value for specific

5-2100, etc. are accounting codes and for each code there is a specific
dollar value. There are only 8 codes.

"Bondi" wrote:


marjoryann wrote:
e.g. if 5-2100 is entered into A1 then A2 should automatically = $31.00, if
5-6100 is entered into A1 then A2 should automatically = $36.00.


Hi,

Is there any connection between text and amount?

Regards,
Bondi


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
Need subtotal function to return text as result Alby Excel Discussion (Misc queries) 0 February 15th 06 10:47 PM
If function with text Richard Excel Worksheet Functions 2 February 13th 06 09:15 PM
UPPER text function Graham Excel Discussion (Misc queries) 5 June 6th 05 06:32 PM
Return value with using Excel function SNOWBALLCHAN New Users to Excel 1 February 21st 05 07:25 AM
Convert Numeric into Text Monty Excel Worksheet Functions 0 December 18th 04 09:25 PM


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