Saturday, February 25, 2012

Would anyone be able to tell me what this looks like as an IF function?:?

If my number of years is 5 then the value of the cell is $$$$. If the number of years is 6, then the value of the cell is $$$$. Else the value of the cell is 0 (or empty).



More Info:

In other words, all the cells for years 5 and 6 will have these conditioning cells. The syntax is the same as the tutorial, so you will just need to replace $$$$ with your formula to compute the increase in cost.



Working on project and really needing help with this asked a bunch of people and no one can explain this to me in terms I quite understand. I would appreciate any help as this would allow me to move forward with this project.



Thanks in advanceWould anyone be able to tell me what this looks like as an IF function?:?
=if ( or ( yrs = 5 , yrs = 6 ) ; "$$$$" ; 0 )Would anyone be able to tell me what this looks like as an IF function?:?
First, nitpicky detail, 'if' is not a function. It is a conditional construct or conditional structure but it is definitely not a function because it doesn't 'do' anything by itself -- it doesn't 'return or change a value.'



Next, always initialise all your variables with something, in this case fill them all with 0.



Next, '0' and 'empty' are not the same thing. 0 is a value, empty is 'nothing.'



Last, instead of a list of if statements look into the case or switch/case structure. It's much easier to read and modify. For PHP see Ref and Example #1. There are similar structures in almost any language.

No comments:

Post a Comment