I have another formula request in excel but this time it is with a range and not sure how to do that

Dealing with Columns E & G and want to set Column O based on the values there

If columns E & G are < 1,000,000 and > 10 then O should be A

NEXT for all the others if G is greater than E use G else use E to determine

If columns E or G are < 5,000,000 and > 999,999 then O should be B

If columns E or G are < 25,000,000 and > 5,000,000 then O should be C

If columns E or G are < 50,000,000 and > 25,000,000 then O should be D

If columns E or G are > 50,000,000 then O should be E