Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
hi
i have a problem with using the if statement. i am updating a calculator where a new value for the 2008 year. 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. N1 HAS A VALUE IN THE CELL 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 I PUT THIS IN BUT THE RESULT RETURNED FOR 2008 STAYED AT 22 ANY IDEAS ?? p.s. C1 HAS CODE IN THE VISUAL BASIC EDITOR DOES THIS HAVE TO BE CHANGED TO INCORPOATE THE 2008 VALUE? |
#2
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
What do you get with the formula =C1?
Another thing to check if you are not getting the expected result is Tools/ Options/ Calculation, & make sure is says Automatic, not Manual. -- David Biddulph "wheefus" wrote in message ... hi i have a problem with using the if statement. i am updating a calculator where a new value for the 2008 year. 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. N1 HAS A VALUE IN THE CELL 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 I PUT THIS IN BUT THE RESULT RETURNED FOR 2008 STAYED AT 22 ANY IDEAS ?? p.s. C1 HAS CODE IN THE VISUAL BASIC EDITOR DOES THIS HAVE TO BE CHANGED TO INCORPOATE THE 2008 VALUE? |
#3
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
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. |
#4
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
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. |
#5
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
=N1*CHOOSE(2+SIGN(2007-C1),24,22,16.8)
Regards, Bernd |
#6
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]() 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 "David Biddulph" wrote: What do you get with the formula =C1? Another thing to check if you are not getting the expected result is Tools/ Options/ Calculation, & make sure is says Automatic, not Manual. -- David Biddulph "wheefus" wrote in message ... hi i have a problem with using the if statement. i am updating a calculator where a new value for the 2008 year. 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. N1 HAS A VALUE IN THE CELL 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 I PUT THIS IN BUT THE RESULT RETURNED FOR 2008 STAYED AT 22 ANY IDEAS ?? p.s. C1 HAS CODE IN THE VISUAL BASIC EDITOR DOES THIS HAVE TO BE CHANGED TO INCORPOATE THE 2008 VALUE? |
#7
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
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 "Bernd P" wrote: =N1*CHOOSE(2+SIGN(2007-C1),24,22,16.8) Regards, Bernd |
#8
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
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. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Conditional Statement with many variables | Excel Discussion (Misc queries) | |||
Too many variables for an if than statement? | New Users to Excel | |||
appending and IF statement to an existing IF statement | Excel Worksheet Functions | |||
Using variables as first and last cells in range statement | Excel Worksheet Functions | |||
Two variables | Excel Discussion (Misc queries) |