S
Simon Wong
For a record I have upto 5 pairs of positive numbers for 10 fields, namely A,
B, C, D, E and V, W, X, Y, Z.
A and V come to a pair such that both A and V must be a positive number > 0.
In case there is more than one pair, the 2nd pair will use B and W
If there are three pairs, then AV, BW and XY will be entered the relevant
positive number. The other fields will becomes "0".
They always comes in pair such that if:
A>0, then V must be >0
A=0, then V must be 0 (which is not possible because there is at least one
pair)
B>0, then W must be >0
B=0, then W must be 0
and so on
Then I create a query field and perform the following calculation:-
(V+W+X+Y+Z) / ( (A/V) + (B/W) + (C/X) + (D/Y) + (E/Z) )
It happens that if any of B/W or C/X or D/Y or E/Z is "0/0", it returns an
Error. Only when 5 pairs all have data, it give a correct calculation.
I know how to use IIf function but it only good for setting one criteria and
in above case it appears there are four different situctions so that the IIf
function cannot manage.
Wish someone can tell me how to deal with my situation.
Best regards
Simon Wong
B, C, D, E and V, W, X, Y, Z.
A and V come to a pair such that both A and V must be a positive number > 0.
In case there is more than one pair, the 2nd pair will use B and W
If there are three pairs, then AV, BW and XY will be entered the relevant
positive number. The other fields will becomes "0".
They always comes in pair such that if:
A>0, then V must be >0
A=0, then V must be 0 (which is not possible because there is at least one
pair)
B>0, then W must be >0
B=0, then W must be 0
and so on
Then I create a query field and perform the following calculation:-
(V+W+X+Y+Z) / ( (A/V) + (B/W) + (C/X) + (D/Y) + (E/Z) )
It happens that if any of B/W or C/X or D/Y or E/Z is "0/0", it returns an
Error. Only when 5 pairs all have data, it give a correct calculation.
I know how to use IIf function but it only good for setting one criteria and
in above case it appears there are four different situctions so that the IIf
function cannot manage.
Wish someone can tell me how to deal with my situation.
Best regards
Simon Wong