Create a “Battery Types” table with the type of battery listed in the first column. Then create a “Toys” table where you have the name of toy and where the “Battery” column is a Lookup from the Battery Types table. This will let you sort and filter easily and keep things consistent.
Then back in the Battery Types table, create a “Total Needed” column and add the formula:
=Toys.Filter(Battery=thisRow).[How Many?].Sum()
Here’s a screenshot of a setup if that helps…