//flex table opened by JP

Click to See Complete Forum and Search --> : Lame Excel question


Hola hoop
08-31-2004, 09:06 AM
Hey guys. simple but lame excell question.
I want to do a boolen function for a spreadsheet, so if i enter Y (yes for VAT) it takes the value of Cell B (example) adds, 17.5% to the figure and displays the new figure in Cell C
If you enter N then is simply displays the value of Cell B in Cell C

Stupid question i know, but can anoyone provide a quick fix?

ScaryBinary
09-02-2004, 12:03 AM
Here it is. I'm assuming that Column A is your starting value, Column B is you "Y" or "N" value, and Column C is your result.

Paste this fomula into Column C:=IF(B1="Y", 1.175*A1,A1)

It just says if cell B1 is "Y", then make cell C1 equal to cell A1 (your starting value) * 1.175 (17.5% more). Otherwise whatever is in cell A1 is returned.

Once you've pasted it into cell C1, you can then use Excel's cut and paste to paste the formula as far down column C as you need to - the cells in the fomula should automatically adjust.

I've included a picture just in case I don't make any sense!

Hola hoop
09-02-2004, 09:32 AM
Thanks ScaryBinary, you really are the man when it comes to formula and code!!!!

Hola hoop
09-03-2004, 08:08 AM
hi i tried the code and it works ok i have changed the arangement a bit and need further advice.

This is my actual code:

IF=(D5 "y". (SUM(G5/1175)*175)

this code works as u enter the FINAL figure and it calc the vat on that and displays the VAT in the coloum where this code is entered. Basically the problem is, when you enter y it Calcs the VAT nicely, but when you do not enter y, instead of nothing or 0.00 in the vat box u get FALSE
any idea how to show nothing or just 0.00 rather than FALSE because of the IF statement?

ScaryBinary
09-03-2004, 10:40 AM
You're missing a parameter in your IF function - you're not telling it what to do if your statement is false. You need something like:
=IF(D5="y", (SUM(G5/1175)*175), 0.00)

Note the commas. The function has three parameters. The first is the statement you're checking. In your case, you're asking if the value in D5 is "y". The second parameter will be returned if that statement is true. So if D5 is in fact "y", 175 times the sum of G5/1175 will be returned. The third parameter, which you are missing, will be returned if the statement is false. So if D5 is anything but "y", the third parameter will be returned. Since you left it out, I guess Excel just fills it in as "FALSE".

Hola hoop
09-03-2004, 10:55 AM
lol sorry ScaryBinary i just typed the = the wrong way round.
The actual code IS
=IF(D5 "y". (SUM(G5/1175)*175)

Ok so your saying if i use the return value of 0.00 then thats what will be displayed, ah ok now i get it.
I spent sum time trying to get the originally entered number in that coloum (0.00) to be left as it but it always wanted to change it to sumthing...duh i should have though of this.

Again ScaryBinary....thanks for your words of wisdom dude :D