JenniferMurphy
Well-known Member
- Joined
- Jul 23, 2011
- Messages
- 2,687
- Office Version
- 365
- Platform
- Windows
I am trying to write a little UDF to check the win-loss-tie records of some teams. I have the data in the table in the minisheet below. Here's the UDF code:
It gets a value error. Can someone tell me what I am doing wrong? Thanks
VBA Code:
Function WLTTally(pWLT As Range) As String
Dim WLT As Variant
WLT = Range(pWLT)
End Function
It gets a value error. Can someone tell me what I am doing wrong? Thanks
2022 NFL Power Rankings.xlsx | |||||||
---|---|---|---|---|---|---|---|
B | C | D | E | F | |||
4 | Team | Record | W | L | T | ||
5 | A | 3-0 | 3 | 0 | |||
6 | B | 2-1 | 2 | 1 | |||
7 | C | 2-1 | 2 | 1 | |||
8 | D | 1-1-1 | 1 | 1 | 1 | ||
9 | E | 1-1-1 | 1 | 1 | 1 | ||
10 | F | 1-2 | 1 | 2 | |||
11 | G | 1-2 | 1 | 2 | |||
12 | H | 0-3 | 0 | 3 | |||
13 | Total | #VALUE! | 11 | 11 | 2 | ||
Sheet3 |
Cell Formulas | ||
---|---|---|
Range | Formula | |
C13 | C13 | =WLTTally([Record]) |
D13 | D13 | =SUBTOTAL(109,[W]) |
E13 | E13 | =SUBTOTAL(109,[L]) |
F13 | F13 | =SUBTOTAL(109,[T]) |