JenniferMurphy
Well-known Member
- Joined
- Jul 23, 2011
- Messages
- 2,676
- Office Version
- 365
- Platform
- Windows
This page says that there is a Null function in Excel:
NULL function - Microsoft Support
But if I enter "=null()" in a cell, I get a #NAME? error.
I ask because I want a cell formula to return Null if one of the source cells is missing. The tables below illustrate what I am trying to do. The mini-sheet follows.
Table 1 has 2 data columns with all values present. The two Z columns calculate the Z Scores for the data columns. The Wt ZSum column calculates the weighted sum of the Z Scores.
Table2 shows what happens if some data values are missing. The data means & std devs are correct, but the Z Scores are off.
In Table3, I set the Z Score to zero for any missing data values. Now the Z Score means are correct, but the std devs are off.
In Table 4, I set the Z Score to null (""?) for any missing data values. The Z Score means & std devs are correct, but I get a value error in the sum. I tried returning null(), but that got a #NAME? error as stated above.
In Table 5, I manually set the Z Score to null (delete key) for any missing data values. Now everything is correct. How can I do this in a formula?
NULL function - Microsoft Support
But if I enter "=null()" in a cell, I get a #NAME? error.
I ask because I want a cell formula to return Null if one of the source cells is missing. The tables below illustrate what I am trying to do. The mini-sheet follows.
Table 1 has 2 data columns with all values present. The two Z columns calculate the Z Scores for the data columns. The Wt ZSum column calculates the weighted sum of the Z Scores.
Table2 shows what happens if some data values are missing. The data means & std devs are correct, but the Z Scores are off.
In Table3, I set the Z Score to zero for any missing data values. Now the Z Score means are correct, but the std devs are off.
In Table 4, I set the Z Score to null (""?) for any missing data values. The Z Score means & std devs are correct, but I get a value error in the sum. I tried returning null(), but that got a #NAME? error as stated above.
In Table 5, I manually set the Z Score to null (delete key) for any missing data values. Now everything is correct. How can I do this in a formula?
Weighted Ratings Demo.xlsx | ||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | R | S | T | U | V | W | X | Y | Z | AA | AB | AC | AD | AE | AF | AG | AH | AI | |||
2 | Table1 | Table2 | Table3 | Table4 | Table5 | |||||||||||||||||||||||||||||||
3 | Weights | 2 | 1 | Weights | 2 | 1 | Weights | 2 | 1 | Weights | 2 | 1 | Weights | 2 | 1 | |||||||||||||||||||||
4 | A | B | Z A | Z B | Wt ZSum | A | B | Z A | Z B | Wt ZSum | A | B | Z A | Z B | Wt ZSum | A | B | Z A | Z B | Wt ZSum | A | B | Z A | Z B | Wt ZSum | |||||||||||
5 | 1 | 9 | -1.26 | +1.26 | -1.26 | 1 | 9 | -1.32 | +1.02 | -1.61 | 1 | 9 | -1.32 | +1.02 | -1.61 | 1 | 9 | -1.32 | +1.02 | -1.61 | 1 | 9 | -1.32 | +1.02 | -1.61 | |||||||||||
6 | 2 | 8 | -0.63 | +0.63 | -0.63 | 8 | -1.90 | +0.44 | -3.37 | 8 | =0.00 | +0.44 | +0.44 | 8 | +0.44 | #VALUE! | 8 | +0.44 | +0.44 | |||||||||||||||||
7 | 3 | 7 | =0.00 | =0.00 | =0.00 | 3 | 7 | -0.15 | -0.15 | -0.44 | 3 | 7 | -0.15 | -0.15 | -0.44 | 3 | 7 | -0.15 | -0.15 | -0.44 | 3 | 7 | -0.15 | -0.15 | -0.44 | |||||||||||
8 | 4 | 6 | +0.63 | -0.63 | +0.63 | 4 | +0.44 | -4.25 | -3.37 | 4 | +0.44 | =0.00 | +0.88 | 4 | +0.44 | #VALUE! | 4 | +0.44 | +0.88 | |||||||||||||||||
9 | 5 | 5 | +1.26 | -1.26 | +1.26 | 5 | 5 | +1.02 | -1.32 | +0.73 | 5 | 5 | +1.02 | -1.32 | +0.73 | 5 | 5 | +1.02 | -1.32 | +0.73 | 5 | 5 | +1.02 | -1.32 | +0.73 | |||||||||||
10 | Means | 3.00 | 7.00 | 0.00 | 0.00 | 0.00 | Means | 3.25 | 7.25 | -0.38 | -0.85 | -1.61 | Means | 3.25 | 7.25 | 0.00 | 0.00 | 0.00 | Means | 3.25 | 7.25 | 0.00 | 0.00 | #VALUE! | Means | 3.25 | 7.25 | 0.00 | 0.00 | 0.00 | ||||||
11 | Std Devs | 1.58 | 1.58 | 1.00 | 1.00 | 1.00 | Std Devs | 1.71 | 1.71 | 1.21 | 2.09 | 1.80 | Std Devs | 1.71 | 1.71 | 0.87 | 0.87 | 1.04 | Std Devs | 1.71 | 1.71 | 1.00 | 1.00 | #VALUE! | Std Devs | 1.71 | 1.71 | 1.00 | 1.00 | 1.04 | ||||||
Sheet5 |
Cell Formulas | ||
---|---|---|
Range | Formula | |
J3,AE3,X3,Q3 | J3 | =AWt |
K3,AF3,Y3,R3 | K3 | =BWt |
E5:E9 | E5 | =([@A]-Table1[[#Totals],[A]])/C$11 |
F5:F9 | F5 | =([@B]-Table1[[#Totals],[B]])/D$11 |
G5:G9,AI5:AI9,AB5:AB9,U5:U9,N5:N9 | G5 | =[@[Z A]]*AWt + [@[Z B]]*BWt |
L5:L9 | L5 | =([@A]-Table2[[#Totals],[A]])/J$11 |
M5:M9 | M5 | =([@B]-Table2[[#Totals],[B]])/K$11 |
S5:S9 | S5 | =IF(ISNUMBER([@A]), ([@A]-Table3[[#Totals],[A]])/Q$11, 0) |
T5:T9 | T5 | =IF(ISNUMBER([@B]), ([@B]-Table3[[#Totals],[B]])/R$11, 0) |
Z5:Z9 | Z5 | =IF(ISNUMBER([@A]), ([@A]-Table4[[#Totals],[A]])/X$11, "") |
AA5:AA9 | AA5 | =IF(ISNUMBER([@B]), ([@B]-Table4[[#Totals],[B]])/Y$11, "") |
AG5,AG7:AG9 | AG5 | =IF(ISNUMBER([@A]), ([@A]-Table5[[#Totals],[A]])/AE$11, "") |
AH5:AH7,AH9 | AH5 | =IF(ISNUMBER([@B]), ([@B]-Table5[[#Totals],[B]])/AF$11, "") |
C10,AE10,X10,Q10,J10 | C10 | =SUBTOTAL(101,[A]) |
D10,AF10,Y10,R10,K10 | D10 | =SUBTOTAL(101,[B]) |
E10,AG10,Z10,S10,L10 | E10 | =SUBTOTAL(101,[Z A]) |
F10,AH10,AA10,T10,M10 | F10 | =SUBTOTAL(101,[Z B]) |
G10,AI10,AB10,U10,N10 | G10 | =SUBTOTAL(101,[Wt ZSum]) |
C11 | C11 | =STDEV.S(Table1[A]) |
D11 | D11 | =STDEV.S(Table1[B]) |
E11 | E11 | =STDEV.S(Table1[Z A]) |
F11 | F11 | =STDEV.S(Table1[Z B]) |
G11 | G11 | =STDEV.S(Table1[Wt ZSum]) |
J11 | J11 | =STDEV.S(Table2[A]) |
K11 | K11 | =STDEV.S(Table2[B]) |
L11 | L11 | =STDEV.S(Table2[Z A]) |
M11 | M11 | =STDEV.S(Table2[Z B]) |
N11 | N11 | =STDEV.S(Table2[Wt ZSum]) |
Q11 | Q11 | =STDEV.S(Table3[A]) |
R11 | R11 | =STDEV.S(Table3[B]) |
S11 | S11 | =STDEV.S(Table3[Z A]) |
T11 | T11 | =STDEV.S(Table3[Z B]) |
U11 | U11 | =STDEV.S(Table3[Wt ZSum]) |
X11 | X11 | =STDEV.S(Table4[A]) |
Y11 | Y11 | =STDEV.S(Table4[B]) |
Z11 | Z11 | =STDEV.S(Table4[Z A]) |
AA11 | AA11 | =STDEV.S(Table4[Z B]) |
AB11 | AB11 | =STDEV.S(Table4[Wt ZSum]) |
AE11 | AE11 | =STDEV.S(Table5[A]) |
AF11 | AF11 | =STDEV.S(Table5[B]) |
AG11 | AG11 | =STDEV.S(Table5[Z A]) |
AH11 | AH11 | =STDEV.S(Table5[Z B]) |
AI11 | AI11 | =STDEV.S(Table5[Wt ZSum]) |
Named Ranges | ||
---|---|---|
Name | Refers To | Cells |
AWt | =Sheet5!$C$3 | AE3, X3, Q3, J3, G5:G9, N5:N9, U5:U9, AB5:AB9, AI5:AI9 |
BWt | =Sheet5!$D$3 | AF3, Y3, R3, K3, G5:G9, N5:N9, U5:U9, AB5:AB9, AI5:AI9 |