I don't have a single formula solution to offer, however, I do have two possible solutions each requiring helper columns. Note that I've assumed that the format for Sheet2 and Sheet3 is consistent.
[Option 1]
1) Group Sheet2 and Sheet3 by first clicking on the tab for Sheet2 and then CONTROL+Clicking on the tab for Sheet3.
2) Enter the following formula in E2, and copy down:
=IF(A2="A",B2&"#"&C2,"")
3) On your summary sheet, let's say Sheet1, let A2 and B2 contain the sheet names Sheet2 and Sheet3.
4) Then try the following formula, which needs to be confirmed with CONTROL+SHIFT+ENTER...
=SUM(IF(T(OFFSET(INDIRECT("'"&A2&"'!A2:A7"),ROW(INDIRECT("2:7"))-2,,1))="A",(1/MMULT(COUNTIF(INDIRECT("'"&A2:B2&"'!E2:E7"),INDIRECT("'"&A2&"'!E2:E7")),{1;1}))*(N(OFFSET(INDIRECT("'"&A2&"'!D2:D7"),ROW(INDIRECT("2:7"))-2,,1))),""))+SUM(IF(T(OFFSET(INDIRECT("'"&B2&"'!A2:A7"),ROW(INDIRECT("2:7"))-2,,1))="A",(1/MMULT(COUNTIF(INDIRECT("'"&A2:B2&"'!E2:E7"),INDIRECT("'"&B2&"'!E2:E7")),{1;1}))*(N(OFFSET(INDIRECT("'"&B2&"'!D2:D7"),ROW(INDIRECT("2:7"))-2,,1))),""))
[Option 2]
1) On your summary sheet, let's say Sheet1, let A2 and B2 contain the sheet names Sheet2 and Sheet3.
2) On your summary sheet, select A3:B8. With these cells selected/highlighted, enter the following formula and confirm with CONTROL+SHIFT+ENTER...
=IF(T(OFFSET(INDIRECT("'"&A2:B2&"'!A2:A7"),ROW(INDIRECT("2:7"))-2,,1))="A",N(OFFSET(INDIRECT("'"&A2:B2&"'!B2:B7"),ROW(INDIRECT("2:7"))-2,,1))&"#"&N(OFFSET(INDIRECT("'"&A2:B2&"'!C2:C7"),ROW(INDIRECT("2:7"))-2,,1)),"")
3) Then try the following formula, which needs to be confirmed with CONTROL+SHIFT+ENTER...
=SUM(IF(A3:B8<>"",(1/COUNTIF(A3:B8,A3:B8))*(N(OFFSET(INDIRECT("'"&A2:B2&"'!D2:D7"),ROW(INDIRECT("2:7"))-2,,1)))))
Hope this helps!