Hello, I'm trying to come up with a function to sum the from a match in the first column down to the last row, summing a second match starting from the row of the first match, using the following sample data:

[TABLE="class: grid, width: 50, align: left"]

a

[/td]10

[/td]a

[/td]5

[/td]x

[/td]9

[/td]b

[/td]8

[/td]b

[/td]20

[/td]x

[/td]21

[/td]x

[/td]7

[/td]c

[/td]11

[/td]x

[/td]3

[/td]x

[/td]12

[/td]

[/TABLE]

Sample input/output would be:

Find "a" & "x" and Sum=10+5+9+21+7+3+12

Find "b" & "x" and Sum=8+20+21+7+3+12

Find "c" & "x" and Sum=11+3+12

I thought this would be simple, but it's hurting my brain a bit. Any help would be greatly appreciated. - Rob