View Single Post
  #8   Report Post  
Posted to microsoft.public.excel.worksheet.functions
wheefus wheefus is offline
external usenet poster
 
Posts: 5
Default how do i if statement for 3 variables

hi the excel program in relation to the question you answered for me earlier
i can email you the program as it cant be posted here
cheers
as answer didnt work

"KLEBESTIFT" wrote:

The way I do 'evaluate formula' in excel 2000, is to click the = button next
to the formula. It opens a window which shows the current function, what all
the variables for it are and what everything currently evaluates to. Then
click on different functions to go up/down the chain.

"joeu2004" wrote:

On Dec 12, 2:27 pm, wheefus wrote:
here is the old if statement:
=IF(C1<=2006,16.8,22)*N1

giving a result for any date of 2006 or before of 16.8 and 22 for 2007.
[....] I taught that this was the updated calculator as 2008 has value
of 24 to return
=IF(C1<=2006,16.8,IF(C1=2007,22,IF(C1=2008,24)))* N1


Following the paradigm of the first example, you should be able to
simplifiy the latter example as follows:

=IF(C1<=2006, 16.8, IF(C1<=2007, 22, 24))*N1

But that probably does not solve your problem.

I PUT THIS IN BUT THE RESULT RETURNED FOR 2008 STAYED AT 22
ANY IDEAS ??


Of course, it depends on what is in C1. If you have Excel 2003 or
later, click on ToolsFormula AuditingEvaluate Formula to step
through the formula evaluation. That might help you see the problem.
Off-hand, I do not see any problem with the extended logic of the IF()
expression, even as you wrote it.

(Unless C1 has a value greater than 2007 but less than 2008, which is
expected to be interpreted as the "2008" condition -- that is, your
IF() expression is intended to result in 24.)

p.s. C1 HAS CODE IN THE VISUAL BASIC EDITOR DOES THIS HAVE
TO BE CHANGED TO INCORPOATE THE 2008 VALUE?


That is very real possibility. There is no way for us to know unless
you post the VBA code. Then again, it might be complicated and not
worth our time to dissect. Using the Evaluate Formula tool should
help you see if that is where the problem is.

PS: If you do not have Evaluate Formula (Excel 2000 or earlier, I
believe), you could highlight portions of the formula in the "fx"
function field under the toolbar and use F9 to see how the sub-
expression is evaluated. Personally, I don't like that approach, at
least not as it is implemented in Excel 2003. But apparently it has
been recommended by experts in these NGs.