The syntax of the SUBTOTAL function
=SUBTOTAL(function_num, ref1, [ref2],…)
Everything boils down to the function_num argument and the ref arguments.
The function_num and at least one ref are required.
The ref1 (…ref2, ref3, etc.) argument is the reference to the cell or range of cells we want to apply SUBTOTAL to.
Now let’s talk about that function_num argument. This is any of 22 available functions denoted by a code number.
The codes available range from 1 to 11, or 101 to 111. If you attempt to put any other value in this argument, it will cause the #VALUE! error.