3 replaced http://mathematica.stackexchange.com/ with https://mathematica.stackexchange.com/
source | link

Please see a potential solution below:

Code:

(*Data sample*)
names = {"a", "b", "c", "d", "e", "f", "g"};
extr = {{{"a", "c"}, "q"}, {{"b", "e", "f"}, "r"}, {{"a", "b"}, "s"}};
data = {{{1}, {1.5`, 1.5`}, {2, 2, 2}}, {{2}, {2.5`, 2.5`}, {3, 3, 
 3}}, {{3}, {3.5`, 3.5`}, {4, 4, 4}}, {{4}, {4.5`, 4.5`}, {5, 5, 
 5}}, {{5}, {5.5`, 5.5`}, {6, 6, 6}}, {{6}, {6.5`, 6.5`}, {7, 7, 
 7}}, {{7}, {7.5`, 7.5`}, {8, 8, 8}}};

(*Operation*)
Total@data[[#]] & /@ (extr /. Association[Table[#[[i]] -> i, {i, Length@#}] &[names]])[[All, 1]]

Output:

{{{4}, {5., 5.}, {6, 6, 6}}, {{13}, {14.5, 14.5}, {16, 16, 16}}, {{3}, {4., 4.}, {5, 5, 5}}}

Reference:
Association
Table
/. | @ | # | & etc./. | @ | # | & etc.

Please see a potential solution below:

Code:

(*Data sample*)
names = {"a", "b", "c", "d", "e", "f", "g"};
extr = {{{"a", "c"}, "q"}, {{"b", "e", "f"}, "r"}, {{"a", "b"}, "s"}};
data = {{{1}, {1.5`, 1.5`}, {2, 2, 2}}, {{2}, {2.5`, 2.5`}, {3, 3, 
 3}}, {{3}, {3.5`, 3.5`}, {4, 4, 4}}, {{4}, {4.5`, 4.5`}, {5, 5, 
 5}}, {{5}, {5.5`, 5.5`}, {6, 6, 6}}, {{6}, {6.5`, 6.5`}, {7, 7, 
 7}}, {{7}, {7.5`, 7.5`}, {8, 8, 8}}};

(*Operation*)
Total@data[[#]] & /@ (extr /. Association[Table[#[[i]] -> i, {i, Length@#}] &[names]])[[All, 1]]

Output:

{{{4}, {5., 5.}, {6, 6, 6}}, {{13}, {14.5, 14.5}, {16, 16, 16}}, {{3}, {4., 4.}, {5, 5, 5}}}

Reference:
Association
Table
/. | @ | # | & etc.

Please see a potential solution below:

Code:

(*Data sample*)
names = {"a", "b", "c", "d", "e", "f", "g"};
extr = {{{"a", "c"}, "q"}, {{"b", "e", "f"}, "r"}, {{"a", "b"}, "s"}};
data = {{{1}, {1.5`, 1.5`}, {2, 2, 2}}, {{2}, {2.5`, 2.5`}, {3, 3, 
 3}}, {{3}, {3.5`, 3.5`}, {4, 4, 4}}, {{4}, {4.5`, 4.5`}, {5, 5, 
 5}}, {{5}, {5.5`, 5.5`}, {6, 6, 6}}, {{6}, {6.5`, 6.5`}, {7, 7, 
 7}}, {{7}, {7.5`, 7.5`}, {8, 8, 8}}};

(*Operation*)
Total@data[[#]] & /@ (extr /. Association[Table[#[[i]] -> i, {i, Length@#}] &[names]])[[All, 1]]

Output:

{{{4}, {5., 5.}, {6, 6, 6}}, {{13}, {14.5, 14.5}, {16, 16, 16}}, {{3}, {4., 4.}, {5, 5, 5}}}

Reference:
Association
Table
/. | @ | # | & etc.

2 Added missing `data` sample set
source | link

Please see a potential solution below:

Code:

(*Data sample*)
names = {"a", "b", "c", "d", "e", "f", "g"};
extr = {{{"a", "c"}, "q"}, {{"b", "e", "f"}, "r"}, {{"a", "b"}, "s"}};
data = {{{1}, {1.5`, 1.5`}, {2, 2, 2}}, {{2}, {2.5`, 2.5`}, {3, 3, 
 3}}, {{3}, {3.5`, 3.5`}, {4, 4, 4}}, {{4}, {4.5`, 4.5`}, {5, 5, 
 5}}, {{5}, {5.5`, 5.5`}, {6, 6, 6}}, {{6}, {6.5`, 6.5`}, {7, 7, 
 7}}, {{7}, {7.5`, 7.5`}, {8, 8, 8}}};

(*Operation*)
Total@data[[#]] & /@ (extr /. Association[Table[#[[i]] -> i, {i, Length@#}] &[names]])[[All, 1]]

Output:

{{{4}, {5., 5.}, {6, 6, 6}}, {{13}, {14.5, 14.5}, {16, 16, 16}}, {{3}, {4., 4.}, {5, 5, 5}}}

Reference:
Association
Table
/. | @ | # | & etc.

Please see a potential solution below:

Code:

(*Data sample*)
names = {"a", "b", "c", "d", "e", "f", "g"};
extr = {{{"a", "c"}, "q"}, {{"b", "e", "f"}, "r"}, {{"a", "b"}, "s"}};

(*Operation*)
Total@data[[#]] & /@ (extr /. Association[Table[#[[i]] -> i, {i, Length@#}] &[names]])[[All, 1]]

Output:

{{{4}, {5., 5.}, {6, 6, 6}}, {{13}, {14.5, 14.5}, {16, 16, 16}}, {{3}, {4., 4.}, {5, 5, 5}}}

Reference:
Association
Table
/. | @ | # | & etc.

Please see a potential solution below:

Code:

(*Data sample*)
names = {"a", "b", "c", "d", "e", "f", "g"};
extr = {{{"a", "c"}, "q"}, {{"b", "e", "f"}, "r"}, {{"a", "b"}, "s"}};
data = {{{1}, {1.5`, 1.5`}, {2, 2, 2}}, {{2}, {2.5`, 2.5`}, {3, 3, 
 3}}, {{3}, {3.5`, 3.5`}, {4, 4, 4}}, {{4}, {4.5`, 4.5`}, {5, 5, 
 5}}, {{5}, {5.5`, 5.5`}, {6, 6, 6}}, {{6}, {6.5`, 6.5`}, {7, 7, 
 7}}, {{7}, {7.5`, 7.5`}, {8, 8, 8}}};

(*Operation*)
Total@data[[#]] & /@ (extr /. Association[Table[#[[i]] -> i, {i, Length@#}] &[names]])[[All, 1]]

Output:

{{{4}, {5., 5.}, {6, 6, 6}}, {{13}, {14.5, 14.5}, {16, 16, 16}}, {{3}, {4., 4.}, {5, 5, 5}}}

Reference:
Association
Table
/. | @ | # | & etc.

1
source | link

Please see a potential solution below:

Code:

(*Data sample*)
names = {"a", "b", "c", "d", "e", "f", "g"};
extr = {{{"a", "c"}, "q"}, {{"b", "e", "f"}, "r"}, {{"a", "b"}, "s"}};

(*Operation*)
Total@data[[#]] & /@ (extr /. Association[Table[#[[i]] -> i, {i, Length@#}] &[names]])[[All, 1]]

Output:

{{{4}, {5., 5.}, {6, 6, 6}}, {{13}, {14.5, 14.5}, {16, 16, 16}}, {{3}, {4., 4.}, {5, 5, 5}}}

Reference:
Association
Table
/. | @ | # | & etc.