"Bob Phillips" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> =IF(OR(D2={"Neither",""}),"",IF(C2="","",C2*LOOKUP(D2,{"GST","PST","PST+GST"},{0.06,0.06,0.13})))
Hi! Thanks for this. I had to adjust for the cells. A lot gets lost in
translation from XL to words, eh? <g> I tried this:
=IF(OR(E2={"Neither",""}),"",IF(D2="","",D2*LOOKUP(E2,{"GST","PST","PST+GST"},{0.06,0.06,0.13})))
But now I get #VALUE! in the 2 adjacent cells, so there's something I'm
doing wrong and I don't know what.
So I'm going back to my original formula and trying to see how to fix that.
It works in every way except for the 2 little nitpicky things (though these
types of things do hang up users, which is why I try to fix them).
Okay, back to square one, when I put a value into D2, 19.99, before I choose
whether or not tax has to be calculated in E2, I get #N/A in F2 (the tax
alone calculation) and another #N/A in G2 (which sums both D2 and the tax in
F2.
Naturally, once I choose which tax in E2, then all the rest of the line is
fine. #N/A disappears and dollar amounts appear in all the other cells
including the running total cell in H2.
That's the first problem.
The second is when "Neither" is used for straight expense where no tax is
involved. I get a $0.00 in the tax cell of E2. The only way two ways I
know how to remove zeroes is 1) to have somewhere a "" in the formula, if
memory serves. But I've tried putting that into the working formula below
and I get the old #VALUE! again, so definitely I'm doing something wrong.
=IF(D2="","",D2*LOOKUP(E2,{"GST","Neither","PST","PST+GST"},{0.06,0,0.06,0.13}))
The second way is through conditional formatting. Unfortunately, I'm using
alternate row colouring on this spreadsheet so that's out ... also, I think
sometimes the calculations are off, no?, because the zero isn't seen ?? (or
am I confusing this with something else.
<sigh> Sorry this one has turned out to be tough. I hope I've explained
better so problem is clearer. Let me know.
> --
> HTH
>
> Bob
>
> (there's no email, no snail mail, but somewhere should be gmail in my
> addy)
>
> "StargateFanFromWork" <(E-Mail Removed)> wrote in message
> news:eYgSW$(E-Mail Removed)...
>> "Bob Phillips" <(E-Mail Removed)> wrote in message
>> news:%23O%(E-Mail Removed)...
>>> =IF(C2="","",C2*LOOKUP(D2,{"GST","Neither","PST","PST+GST"},{0.06,0,0.06,0.13}))
>>
>> Great! A whole new way of doing things that I'd never seen before.
>> Another formula to go into my TIPS folder <g>.
>>
>> I actually only ran into a couple of challenges, any way to not have the
>> 2nd result for "Neither" as $0.00, not show up? I'd like to be able to
>> choose that "Neither" option, but I think I'd prefer that the cell remain
>> blank and not show up as $0.00.
>>
>> Also, when no text string is chosen and the cell is just blank, a #N/A
>> appears in E2. Can you recommend how to handle this one, by any chance?
>>
>> Thanks much! This is great.
D
>>
>>> --
>>> HTH
>>>
>>> Bob
>>>
>>> (there's no email, no snail mail, but somewhere should be gmail in my
>>> addy)
>>>
>>> "StargateFanFromWork" <(E-Mail Removed)> wrote in message
>>> news:(E-Mail Removed)...
>>>>I have this formula that goes into E2 in the first line:
>>>> =IF(C2<>"",IF(D2="PST+GST",SUMPRODUCT(C2*0.13),""))
>>>> which works if the text string PST+GST is found in D2. But I don't
>>>> know how to branch out from there. There are 4 possible answers to go
>>>> into D2 which will affect outcome of E2. They are, and I'll list them
>>>> all including the PST+GST case above:
>>>>
>>>> if D2 = text string "PST+GST", E2 = SUMPRODUCT(C2*0.13)
>>>> if D2 = text string "PST", E2 = SUMPRODUCT(C2*0.06)
>>>> if D2 = text string "GST", E2 = SUMPRODUCT(C2*0.06) [currently both
>>>> taxes are equal where for years they were 0.06 and 0.07]
>>>> if D2 = text string "Neither", E2 = nothing, no change to C2
>>>>
>>>> I'm using the above formula because that's what I know more or less how
>>>> to do. But there might be something better (?).
>>>>
>>>> Also, when playing around with figures, I have had some FALSE and
>>>> #VALUE appear, so hoping to cross that bridge when I get to it. <g>
>>>>
>>>> Thanks!
D
>>>>
>>>>
>>>
>>>
>>
>>
>
>