You can change the cell reference type, manually and painfully using $ signs before the row numbers and/or column headers.
Or, you can take the easy route using the F4 key.
To use, insert the ‘=’ sign in the cell, then use your mouse to select the cell you are referencing. ex. =A8. Now use the F4 key repeatedly until you get the type of reference you need. For ex. it will cycle through $A$8, then with the next F4 use, it will go to A$8, then $A8.
Once you get to the type of reference you want, you can move on to the next part of your formula.