Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 39
Default Multiple Functions of a Cell

I'm trying to use this spread sheet for purchasing fuel and to subtract the
fuel tax from the pump price when I purchase fuel so if I type in cell B2 IL
I want $0.43 to show up in Cell C2 but... If I type IN in cell B2 I want
$0.16 to show up in Cell C2 and so on for all the States I buy fuel in
=IF(C2="IL",0.43,0) if I type this in Cell C2 that is good for IL but I can't
seem to do a multiple =IF in the same Cell
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 117
Default Multiple Functions of a Cell

Drew,

I presume your fuel prices will change from time to time so I would use a
lookup table somewhere in the workbook with the State in the first column
and the fuel price in the second column. This would allow you to easily
update the fuel cost for each state.
Then place the following formula in C2.
=IF(ISNA(VLOOKUP(B2,Lookup_Table,2,0)),"",VLOOKUP( B2,Lookup_Table,2,0))
Replace "Lookup_Table" with the range that contains your table. If you don't
use a named range be sure to use an absolute reference for the table. i.e.
$I$2:$J$51
You can copy this formula down as needed.
Hope this helps.

Dave


"Drew" wrote in message
...
I'm trying to use this spread sheet for purchasing fuel and to subtract
the
fuel tax from the pump price when I purchase fuel so if I type in cell B2
IL
I want $0.43 to show up in Cell C2 but... If I type IN in cell B2 I want
$0.16 to show up in Cell C2 and so on for all the States I buy fuel in
=IF(C2="IL",0.43,0) if I type this in Cell C2 that is good for IL but I
can't
seem to do a multiple =IF in the same Cell



  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 515
Default Multiple Functions of a Cell

You could use =IF(C2="1L",0.43,IF(C2="1N",0.16, and so on. However, if you
travel through all the states, you will have a problem, since you have a
limitation of seven IF's. You could also set up a lookup table, having iL,
iN etc in one column, and the relevant values in the next column.

Say in AA you have your iL, iN etc, and in AB you have 0.43, 0.16 and so on.
Name this range say States.

Now, in C2 enter =IF(C2="","",VLOOKUP(C2,States,2,0)), and your problem
should be solved.

--
HTH

Kassie

Replace xxx with hotmail


"Drew" wrote:

I'm trying to use this spread sheet for purchasing fuel and to subtract the
fuel tax from the pump price when I purchase fuel so if I type in cell B2 IL
I want $0.43 to show up in Cell C2 but... If I type IN in cell B2 I want
$0.16 to show up in Cell C2 and so on for all the States I buy fuel in
=IF(C2="IL",0.43,0) if I type this in Cell C2 that is good for IL but I can't
seem to do a multiple =IF in the same Cell

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
JCS JCS is offline
external usenet poster
 
Posts: 93
Default Multiple Functions of a Cell

Hi Drew,

Instead of using the IF function try a combination of the IF and Vlookup
functions. First, somewhere in your spreadsheet create a list of states and
then in the column next to the states type in the tax rates. Then in the
cell where you want the results, type
=IF(ISNA(VLOOKUP(A2,F2:G5,2)),0,VLOOKUP(A2,F2:G5,2 )) In the vlookup F2:F6
(in this example) is thel ist of states and tax rates.
Please press Yes if this helps.

Regards,
John

"Drew" wrote:

I'm trying to use this spread sheet for purchasing fuel and to subtract the
fuel tax from the pump price when I purchase fuel so if I type in cell B2 IL
I want $0.43 to show up in Cell C2 but... If I type IN in cell B2 I want
$0.16 to show up in Cell C2 and so on for all the States I buy fuel in
=IF(C2="IL",0.43,0) if I type this in Cell C2 that is good for IL but I can't
seem to do a multiple =IF in the same Cell

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
Multiple functions in one cell cgroninger Excel Worksheet Functions 4 May 9th 08 04:04 PM
multiple functions on one cell ? Tim R Excel Discussion (Misc queries) 6 October 24th 07 09:40 AM
Multiple functions in a cell help Mikjall777 New Users to Excel 5 August 11th 06 02:23 PM
MUltiple functions on a same cell harshaputhraya Excel Discussion (Misc queries) 1 May 8th 06 06:28 AM
Multiple functions per cell? excelnewbie Excel Worksheet Functions 6 September 19th 05 09:33 AM


All times are GMT +1. The time now is 12:50 AM.

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"