|Let's work backwards through your post:|
re: In the end the formula needs to be divide the first sumif range by the sumif range of the second + the sumif of the third. (C4:AF4/AI4:BL4 + BO4:CR4).
Your words don't match your formula or vice versus.
If you mean SUMIF(1) divided by the SUM of SUMIF(2) and SUMIF(3) then you need to add some parenthesis to your "example":
C4:AF4 / (AI4:BL4 + BO4:CR4)
As written, C4:AF4 / AI4:BL4 + BO4:CR4 means:
Divide SUMIF(1) by SUMIF(2) and then add SUMIF(3) to that result.
OK, so I think this is what you are asking for:
=SUMIF(C2:AF2, DA2, C4:AF4) / (SUMIF(AI2:BL2, DA2, AI4:BL4) + SUMIF(BO2:CR2, DA2, BO4:CR4))
Let us know how that works for you.