As there is no clarity in the Act with respect to the computation of deduction amount when an assessee can claim both 80G and 80GG simultaneously in a previous year, it can be done according to one's wish without violating any laws or provisions in this regard, so that the assessee can get full benefit.
In my opinion, simultaneous equation cannot be constructed with the available data and using other mathematical tools can also make it more complicated. For a simple technique, I suggest you do two cases and choose whichever is beneficial:
Case I: Compute amount u/s 80G first, and ignore the amount u/s 80GG for the purpose, as the amount under sec 80GG is not known. Then compute sec 80GG by considering the amount u/s80G, because it has been computed already. (In short, 80GG is ignored for 80G calculation and for 80GG calculation, 80G is considered.)
Case II: Compute amount u/s 80GG first, and ignore the amount u/s 80G for the purpose, as the amount under sec 80G is not known. Then compute sec 80G by considering the amount u/s80GG, because it has been computed already. (In short, 80G is ignored for 80GG calculation and for 80G calculation, 80GG is considered.)
Let me show you a numerical calculation to clarify my opinion, for this, I am taking the question asked by @ CA Diwakar. You can see my calculations in the attached pdf.
This is purely my opinion. Thank you.