I am using a formula of the structure:
{=SUM(SUBTOTAL(function, OFFSET(ROW(Array_name)- ROW(start_row),,1) * A_TEST_CONDITION)} to add up values in a table that match the criteria of A_TEST_CONDITION.
A_TEST_CONDITION uses a column from the array and compares it to a fixed value.
It works really well when I have numbers in the array column to be tested, i.e., "1, 2, 3" but if I try to use a string variable, i.e., "ABC" the function comes back with a N/A error.
So if I have this array have 1 for the fixed value I get 36, for 2 I get 19.
1 14
1 22
2 10
2 09
However if I go to this:
1 14
ABC 22
2 10
2 09
It stops working and returns N/A. The only thing I can see if that I've noticed in the array when I type in the "ABC" into the it actually forces a quote in front of the character ('ABC) which I'm wondering if that is a problem somehow.
If I delete the portion of the formula with the test condition it works fine, likewise if it's all numeric also ok. Doesn't make sense. The cells are set to general format, i've tried 'text' as well to no avail...
Using Excel 2010. Any ideas out there?
{=SUM(SUBTOTAL(function, OFFSET(ROW(Array_name)- ROW(start_row),,1) * A_TEST_CONDITION)} to add up values in a table that match the criteria of A_TEST_CONDITION.
A_TEST_CONDITION uses a column from the array and compares it to a fixed value.
It works really well when I have numbers in the array column to be tested, i.e., "1, 2, 3" but if I try to use a string variable, i.e., "ABC" the function comes back with a N/A error.
So if I have this array have 1 for the fixed value I get 36, for 2 I get 19.
1 14
1 22
2 10
2 09
However if I go to this:
1 14
ABC 22
2 10
2 09
It stops working and returns N/A. The only thing I can see if that I've noticed in the array when I type in the "ABC" into the it actually forces a quote in front of the character ('ABC) which I'm wondering if that is a problem somehow.
If I delete the portion of the formula with the test condition it works fine, likewise if it's all numeric also ok. Doesn't make sense. The cells are set to general format, i've tried 'text' as well to no avail...
Using Excel 2010. Any ideas out there?
Last edited: