We know that sumif function is a combination of sum and if formula and hence sumif can come quite handy for adding cells based on color By default, excel doesn't offer a direct feature to count or sum by color If you don’t know how to use a sumif function, then before going any further i would strongly suggest you to read this post.
SUMIF(S) Based on Cell Color - TeachExcel.com
Learn how to sum and count excel cells by color with 3 easy methods
Save time, reduce errors, and boost your data analysis skills today
So, with the help of vba code, you can create a custom function to summing colored cells You can follow the below steps for that Go to the developer tab and click visual basic. A quick way to sum and count colored cells in excel by using custom functions and macros
In a range or across entire workbook.