#1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3
Default multiple answers

In need to us something similar to IF function but to have multiple answers ie
if A3=5 then A5=$9
If A3=6 then A5=$12
IF A3=55 Then A5=$30
Any help would be greatly appreciated
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
JMB JMB is offline
external usenet poster
 
Posts: 2,062
Default multiple answers

You could use a lookup. As long as the lookup vector is in ascending order
(ie 5,6,55) in A5, enter
=LOOKUP(A3,{5,6,55},{9,12,30})

If you have more numbers to add, you might set up a lookup table. Let's say
C1:D10 is the lookup table. Then
=LOOKUP(A3, C1:C10, D1:D10)

If the lookup vector (or key) isn't in ascending order, look at VLOOKUP.


"AndyS" wrote:

In need to us something similar to IF function but to have multiple answers ie
if A3=5 then A5=$9
If A3=6 then A5=$12
IF A3=55 Then A5=$30
Any help would be greatly appreciated

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 10,593
Default multiple answers

Simple If

=IF(A3=5,9,IF(A3=6,12,IF(A3=55,30,"")))

in A5 and format as $ amount.

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"AndyS" wrote in message
...
In need to us something similar to IF function but to have multiple

answers ie
if A3=5 then A5=$9
If A3=6 then A5=$12
IF A3=55 Then A5=$30
Any help would be greatly appreciated



  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 266
Default multiple answers

"AndyS" skrev i en meddelelse
...
In need to us something similar to IF function but to have multiple
answers ie
if A3=5 then A5=$9
If A3=6 then A5=$12
IF A3=55 Then A5=$30
Any help would be greatly appreciated


Andy

One more way:

=INDEX({9,12,30},MATCH(A3,{5,6,55},0))


--
Best regards
Leo Heuser

Followup to newsgroup only please.


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
macro copy/paste data from multiple cells to multiple cells Diana Excel Discussion (Misc queries) 0 July 10th 06 09:24 PM
Need help in rounding answers to nearest multiple Wasatch Excel Worksheet Functions 6 July 6th 06 05:53 PM
How do I make an IF statement have multiple TRUE answers? JULESFAR Excel Discussion (Misc queries) 1 July 1st 06 01:30 AM
MATCH w/ multiple answers? fastballfreddy Excel Worksheet Functions 8 May 11th 06 06:46 AM
Adding multiple worksheets Craig Excel Worksheet Functions 1 July 6th 05 07:21 PM


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