One approach is to turn this into a lookup. Here is the gist with an example similar to your first problem.
I kept everything at the beginning of the spreadsheet for simplicity. Your AC9 is my C1. Your AC4 is my D1. I just stuck a result in D1 equal to AB4+7
(I just made up what that result would be).
You want to assign values if AC9 is a number in a certain range and AC4 equals a certain value. I handle the AND requirement by concatenating the two.
Columns F and G contain a lookup table. You can expand the table as needed. In a case like this, you could use a formula that you replicate to populate the table as needed. For example, your F1 formula could be:
=ROW()&$AB$4+7
Copying that down the column would use the row number to increment your target AC9 value, and concatenate that to the target value of AB4+7
.
Column G contains the value you want. So you could use a formula like:
=ROW()&"b"
Copying that down the column will populate you result values.
To do the lookup, my formula in A1 is:
=IFERROR(VLOOKUP($C$1&$D$1,$F$1:$G$5,2,0),"")
This creates a lookup value by concatenating the current values of C1 and D1 in my spreadsheet, and comparing that to the values in column F, looking for an exact match. If it finds a match, it pulls the associated value from column G.
If there is no match, the lookup will produce an error. Wrapping the VLOOKUP with IFERROR assigns a null result if there is an error (no match).
Your second example doesn't even require concatenation, just a lookup table containing the numbers to compare AB18 against, and the associated calculation as the result.