bruderbell
Active Member
- Joined
- Aug 29, 2006
- Messages
- 374
I'm trying to come up with a formula to conditionally sum the parts of cells in an array.
Column A
A-8
x
x
x
S-2
s-1.75
a-9.5
So I'm trying to find the sum of values that begin only with s, either caps or not.
I think this'll be a sumproduct, but I am running into trouble when I try to insert a FIND in the formula
I think one of the arrays will be this: --(UPPER(LEFT(A1:A7,1)))="S"
That returns a nice 0 or 1. So if I can just get an array to return all of the numbers to the right of the "-" I'll be in business. So it seems like I should make my second array:
RIGHT(A1:A7,LEN(A1:A7)-FIND("-",A1:A7))
But not every value in the array has a dash, so the FIND is throwing #VALUE!. I thought of using MID(A1:A7,2) but that throws an error because not every field has a second character. And when I add IFERROR it doesn't help either one. Here's what I tried for the second array with an IFERROR:
RIGHT(A1:A7,LEN(A1:A7)-IFERROR(FIND("-",A1:A7),0))
It seems that the FIND is throwing a single #VALUE! instead of trying each value and throwing an array of valid responses and errors.
Any ideas on making this scenario work? I'd like to solve it formulaically and avoid creating extra intermediary cells.
Thanks!
Column A
A-8
x
x
x
S-2
s-1.75
a-9.5
So I'm trying to find the sum of values that begin only with s, either caps or not.
I think this'll be a sumproduct, but I am running into trouble when I try to insert a FIND in the formula
I think one of the arrays will be this: --(UPPER(LEFT(A1:A7,1)))="S"
That returns a nice 0 or 1. So if I can just get an array to return all of the numbers to the right of the "-" I'll be in business. So it seems like I should make my second array:
RIGHT(A1:A7,LEN(A1:A7)-FIND("-",A1:A7))
But not every value in the array has a dash, so the FIND is throwing #VALUE!. I thought of using MID(A1:A7,2) but that throws an error because not every field has a second character. And when I add IFERROR it doesn't help either one. Here's what I tried for the second array with an IFERROR:
RIGHT(A1:A7,LEN(A1:A7)-IFERROR(FIND("-",A1:A7),0))
It seems that the FIND is throwing a single #VALUE! instead of trying each value and throwing an array of valid responses and errors.
Any ideas on making this scenario work? I'd like to solve it formulaically and avoid creating extra intermediary cells.
Thanks!
Last edited: