what am I thinking....
or do I need to do an IIF statement?
Yes.
The lack of a Max() or Min() function in VBA is annoying. (Not to beconfused with Max and Min in SQL.)
eta: OK, here's a worse way of doing it: ((b-a) + Abs(b-a))/2
Got a question about technology? Ask it here. Discussion of hardware, software, TiVos, multi-region DVDs, Windows, Macs, LINUX, hand-helds, iPods, anything tech related. Better than any helpdesk!
what am I thinking....
or do I need to do an IIF statement?
Yes.
The lack of a Max() or Min() function in VBA is annoying. (Not to beconfused with Max and Min in SQL.)
eta: OK, here's a worse way of doing it: ((b-a) + Abs(b-a))/2
OK, here's a worse way of doing it: ((b-a) + Abs(b-a))/2
Ha!
It is annoying though. All I needed was a way to make a number between 0 and 100% (i.e., no negative percents and nothing greater than 100%), and I had to use nested IIF statements. Ridiculous!
You could do:
IIF(b-a <0 Or b-a >100,0,b-a)
(Assuming the numbers have already been converted to %.)
eta: Oh wait, you pro'lly wanna convert >100 to 100, right? Then you gotta do the nested IIF.
Forget the b-a part. That was just an example. I'm actually taking a complicated quotient. But besides that, I think your logic is flawed. Your statement returns 0 if b-a is greater than 100. It should return 100.
t edit Yes, your edit is correct!
If you have to do this sort of calculation a lot, you could just write a function to handle it.
could someone post the link to the mobile version of google reader? the standard version keeps crashing my treo (java) and my flight's delayed an hour...
oh you are made of awesome!
Hi, is anyone here?
Please please? I'm a moron, and I need to ask a non-moron some questions please!!!