MS Office Forum / Excel / Worksheet Functions / March 2008
Help with IF function please 03.08.08
|
|
Thread rating:  |
Essjay - 08 Mar 2008 20:14 GMT Can anyone help with syntax for an IF formula as under: If E17=E (for exempt) then F17=$0.00 but If E17=V (for VAT) then F17=G17*17.5% I have an invoice on which some items are taxable and some not. If I put the E or V letter in Column E, then I want it to return either a zero value or to calculate the tax in column F on Column G at 17.5%. Is this possible?
e.g. A B - D E F G Qty. Desc. E $0.00 200.00 Qty. Desc. V $147.00 840.00
Any help much appreciated.
Sean Timmons - 08 Mar 2008 20:38 GMT I would suggest =if(E17="V",G17*.0175,0)
So that, if any value other than V, then $0.
> Can anyone help with syntax for an IF formula as under: > If E17=E (for exempt) then F17=$0.00 but [quoted text clipped - 8 lines] > > Any help much appreciated. Essjay - 08 Mar 2008 21:22 GMT Thanks for your prompt help! Mission accomplished!
> I would suggest > =if(E17="V",G17*.0175,0) [quoted text clipped - 13 lines] > > > > Any help much appreciated. Tyro - 08 Mar 2008 21:28 GMT What if the value is not V or E?
Tyro
> Thanks for your prompt help! Mission accomplished! > [quoted text clipped - 19 lines] >> > >> > Any help much appreciated. Sean Timmons - 08 Mar 2008 20:38 GMT Oops.. that's .175, not .0175...
> Can anyone help with syntax for an IF formula as under: > If E17=E (for exempt) then F17=$0.00 but [quoted text clipped - 8 lines] > > Any help much appreciated. Rick Rothstein (MVP - VB) - 08 Mar 2008 20:39 GMT Assuming E and V are the only entry possibilities for Column E, try this formula...
=G17*(E17="V")*17.5%
Rick
> Can anyone help with syntax for an IF formula as under: > If E17=E (for exempt) then F17=$0.00 but [quoted text clipped - 10 lines] > > Any help much appreciated. Essjay - 08 Mar 2008 21:23 GMT Thanks for prompt assistance. Done!
> Assuming E and V are the only entry possibilities for Column E, try this > formula... [quoted text clipped - 17 lines] > > > > Any help much appreciated. Tyro - 08 Mar 2008 20:39 GMT In G17 put this formula =IF(E17="V",F17*17.5%,IF(E17="E",0,"?")) You don't state what to put in G17 if E17 is not a V or an E so I put a ?
Tyro
> Can anyone help with syntax for an IF formula as under: > If E17=E (for exempt) then F17=$0.00 but [quoted text clipped - 10 lines] > > Any help much appreciated. Tyro - 08 Mar 2008 20:42 GMT Correction:
In F17 put this formula =IF(E17="V",G17*17.5%,IF(E17="E",0,"?"))
Tyro
> In G17 put this formula =IF(E17="V",17*17.5%,IF(E17="E",0,"?")) > You don't state what to put in G17 if E17 is not a V or an E so I put a ? [quoted text clipped - 15 lines] >> >> Any help much appreciated. Essjay - 08 Mar 2008 21:24 GMT Thanks for your prompt help. I was almost there... you've all been fantastic!
> Correction: > [quoted text clipped - 21 lines] > >> > >> Any help much appreciated. T. Valko - 08 Mar 2008 20:45 GMT Try this in F17:
=(E17="V")*G17*17.5%
 Signature Biff Microsoft Excel MVP
> Can anyone help with syntax for an IF formula as under: > If E17=E (for exempt) then F17=$0.00 but [quoted text clipped - 10 lines] > > Any help much appreciated. Tyro - 08 Mar 2008 20:52 GMT Obfuscation? This person is a tyro. Simple IF's will help the OP
Tyro
> Try this in F17: > [quoted text clipped - 14 lines] >> >> Any help much appreciated. T. Valko - 08 Mar 2008 21:31 GMT >This person is a tyro. If you say so. Is that good or bad?
 Signature Biff Microsoft Excel MVP
> Obfuscation? This person is a tyro. Simple IF's will help the OP > [quoted text clipped - 19 lines] >>> >>> Any help much appreciated. Tyro - 08 Mar 2008 21:45 GMT It both. It's bad if you're a tyro. If's ok if you've been programming for 44 years as I have. I've seen obfuscation that would blow your socks off <g>.
Tyro
> >This person is a tyro. > [quoted text clipped - 23 lines] >>>> >>>> Any help much appreciated. Bob Phillips - 08 Mar 2008 22:08 GMT If the OP doesn't understand, he can always ask how it works and why Biff is suggesting it that way. It's called improving your skills.
 Signature --- HTH
Bob
(there's no email, no snail mail, but somewhere should be gmail in my addy)
> Obfuscation? This person is a tyro. Simple IF's will help the OP > [quoted text clipped - 19 lines] >>> >>> Any help much appreciated. Tyro - 08 Mar 2008 22:26 GMT I think you missed the point. The OP is just beginning to learn. It's counter productive to use advanced techniques just to save a few keystrokes or confuse the OP with something he/she doesn't grasp at all. (A snow job). You have to see it from the beginner's point of view and apply the KISS principle. With time and experience, the OP will learn more sophisticated techniques. Let's not jump to advanced calculus before we have learned simple arithmetic. BTW, I blew the final calculus exam in college. I got 99%. I screwed up royally by not putting +C at the end of an integration answer. Lost 1%. Cost me a perfect paper.
Tyro
.
> If the OP doesn't understand, he can always ask how it works and why Biff > is suggesting it that way. It's called improving your skills. [quoted text clipped - 22 lines] >>>> >>>> Any help much appreciated. Sean Timmons - 08 Mar 2008 22:30 GMT May I add, now I learned a more efficent way to perform the calculation, so I can't complain too much.
> If the OP doesn't understand, he can always ask how it works and why Biff is > suggesting it that way. It's called improving your skills. [quoted text clipped - 22 lines] > >>> > >>> Any help much appreciated. Tyro - 08 Mar 2008 22:41 GMT I doubt it is more efficient. Obfuscated, certainly.
Tyro
> May I add, now I learned a more efficent way to perform the calculation, > so I [quoted text clipped - 29 lines] >> >>> >> >>> Any help much appreciated. Bob Phillips - 09 Mar 2008 23:02 GMT >I doubt it is more efficient. Obfuscated, certainly. Well I am afraid you are just plain wrong there.
I just timed it and Biff''s is 31% faster than Sean's first formula, and 41% faster than yours. By my reckoning that is more efficient.
Tyro - 09 Mar 2008 23:18 GMT I don't think that execution time should take predence over the understanding of a simple formula. How much time is involved here. 10 microseconds? 20 microseconds, 5 days?
Tyro
>>I doubt it is more efficient. Obfuscated, certainly. > > Well I am afraid you are just plain wrong there. > > I just timed it and Biff''s is 31% faster than Sean's first formula, and > 41% faster than yours. By my reckoning that is more efficient. Bob Phillips - 10 Mar 2008 10:20 GMT That is another argument. You said, and I quote, ... I doubt it is more efficient.
 Signature --- HTH
Bob
(there's no email, no snail mail, but somewhere should be gmail in my addy)
>I don't think that execution time should take predence over the >understanding of a simple formula. How much time is involved here. 10 [quoted text clipped - 8 lines] >> I just timed it and Biff''s is 31% faster than Sean's first formula, and >> 41% faster than yours. By my reckoning that is more efficient. Bob Phillips - 09 Mar 2008 22:50 GMT And that is another benefit, others read these posts and learn things too.
 Signature --- HTH
Bob
(there's no email, no snail mail, but somewhere should be gmail in my addy)
> May I add, now I learned a more efficent way to perform the calculation, > so I [quoted text clipped - 29 lines] >> >>> >> >>> Any help much appreciated. Roger Govier - 09 Mar 2008 11:40 GMT Hi
You have received many answers, each of which will deal with the calculation you asked. However, if you are dealing with UK VAT, I have some observations to add.
Under UK HMCE rules there are codes for several different VAT rates - Z,X,E,O,S,L,H,I,P There is no VAT code V, it should be S for Standard to attract a current rate of 17.5% , so from both your viewpoint, and that of the invoice recipient, it would serve you well to comply with the HMCE directive.
L - Lower currently 5% (only applies the Domestic Fuel bills and is probably something you would not be using) H - Higher rate is not currently being used S - Standard is currently 17.5% P - Partial Exemption (unlikely to be used in your particular case - applies to some property situations)
X - Excluded, E - Exempt, O - Outside the scope and Z - Zero are all 0%
Personally, I would have Column F as the Net Amount, Column G as the VAT Amount and column H as the Gross amount. The formula in column G would then become =IF(E17="S",ROUND(F17*17.5%,2),0)
Without knowing your circumstances, I would suspect that it is is S and Z you should be using, rather than V and E. You should confirm with your HMCE inspector to ensure that you are complying.
 Signature Regards Roger Govier
> Can anyone help with syntax for an IF formula as under: > If E17=E (for exempt) then F17=$0.00 but [quoted text clipped - 10 lines] > > Any help much appreciated. Essjay - 12 Mar 2008 18:50 GMT Hi Roger Thanks for the comprehensive answer. You're correct in that my query does deal with UK VAT. The only reason I used the letters V & E was more as an "aide memoire" for the person doing the input ~ V to stand for VATable and E for Exempt. The VAT element will only ever fall into the customary standard 17.5% (unless otherwise amended by HMG!), or be Exempt, so I was trying to apply the KISS principle to the formula. I will re-jig the columnisation to reflect your suggestion. I'd just like to thank everyone for the time they've taken with my query and for sharing their knowledge so readily. Regards Essjay
> Hi > [quoted text clipped - 40 lines] > > > > Any help much appreciated.
|
|
|