# Thread: Help with calculation (2003)

1. ## Help with calculation (2003)

I have the following calculation:
CountY: Abs((NZ([Rcac hlh in],"")="Y")+(NZ([Rcac Hlh Sr in],"")="Y")+(NZ([Rcac Hlh Den in],"")="Y")+(NZ([Rcac Hlh Vis in],"")="Y")+(NZ([Rcac Davis in],"")="Y")+(NZ([Rcac UCCI in],"")="Y")+(NZ([Rcac HMIG in],"")="Y")+(NZ([Rcac MtSt HlH In],"")="Y")+(NZ([Rcac MtSt Sr In],"")="Y"))

It works but I have to make two changes and I need some syntax help. I need to count Rcac hlh in and Rcac Hlh Sr in as one if either are = to "Y" and the same for MtSt HlH In and Rcac MtSt Sr In to only count as one Y if either of are = to Y. So I need to combine them to equal only one Y. Hope I am making sense. thanks for your help.

2. ## Re: Help with calculation (2003)

Try

CountY: Abs(((NZ([Rcac hlh in],"")="Y") Or (NZ([Rcac Hlh Sr in],"")="Y"))+(NZ([Rcac Hlh Den in],"")="Y")+(NZ([Rcac Hlh Vis in],"")="Y")+(NZ([Rcac Davis in],"")="Y")+(NZ([Rcac UCCI in],"")="Y")+(NZ([Rcac HMIG in],"")="Y")+((NZ([Rcac MtSt HlH In],"")="Y") Or (NZ([Rcac MtSt Sr In],"")="Y")))

I replaced the + between the conditions that are to be combined with Or and I placed an extra set of parentheses ( ) around the pairs.