Justin Jolley
Justin Jolley

Reputation: 1

Is there a way to copy certain parts of a formula down a column in Google Sheets?

I'm creating a Google Sheet documenting how many times a certain item appears in a video game with the formula in the D column (formatted to a percent):

=IFERROR(C2/SUM(C2:C51))

I want the "C2" cell to apply down the column (C3, then C4, you get the idea), but I want the "C2:C51" array to stay constant while the C2 part gets applied down the down the column. How could I modify the formula to do this? (I could manually edit the formulas all the way down, I only have 50 rows, but I think it would be helpful to learn for the future)

Upvotes: 0

Views: 31

Answers (1)

doubleunary
doubleunary

Reputation: 19065

Try this:

=iferror(C2 / sum(C$2:C$51))

See absolute and relative references.

Alternatively, try this array formula that fills a whole column in one go:

=arrayformula(iferror(C2:C51 / sum(C2:C51)))

Upvotes: 1

Related Questions