Share via

Using a range in a formula

Richard Tillman 260 Reputation points
2026-05-21T17:37:58.44+00:00

Hi, I'm new to using a range in a formula, rather than just making a formula for one cell (in terms of that cell) & then copying that cell to other cells (with Excel updating the references). I have this formula in C3:

=if(abs(mround($B3,C$2)-$B3)<=$B$2/2,round($B3/C$2,0) & "=" & mround($B3,C$2),"")

and it does what I want when I copy it to C3:o43. How do I make that into a range formula? (And do I just put that in C3?)

Thank you

Microsoft 365 and Office | Excel | For home | Windows

Answer accepted by question author

Barry Schwarz 5,756 Reputation points
2026-05-22T12:51:13.92+00:00

This may be slightly simpler than IlirU's solution

=LET(rr,B3:B43,cc,C2:O2,DROP(REDUCE(0,rr,LAMBDA(s,b,VSTACK(s,DROP(REDUCE(-1,cc,LAMBDA(t,c,HSTACK(t,IF(ABS(MROUND(b,c)-b)<=$B$2/2,ROUND(b/c,0)&"="&MROUND(b,c),"")))),0,1)))),1))

However I think your original solution is much easier to understand and therefore easier to maintain. The only virtue of either of our complex solutions is if the arguments of the IF function are likely to change then the change is confined to a single formula without any need for propagation.

Was this answer helpful?

1 person found this answer helpful.

Answer accepted by question author

IlirU 2,491 Reputation points Volunteer Moderator
2026-05-22T05:22:02.99+00:00

User's image

Hi @Richard Tillman ,

Is this the formula you are looking for?

=TRANSPOSE(TEXTSPLIT(TEXTJOIN(";",, BYCOL(C2:O2, LAMBDA(col, ARRAYTOTEXT(BYROW(B3:B43, LAMBDA(rw, ARRAYTOTEXT(IF(ABS(MROUND(rw, col) - rw) <= B2 / 2, ROUND(rw / col, 0) & " = " & MROUND(rw, col), "")))))))), ", ", ";"))

Hope this helps.

IlirU

Was this answer helpful?

1 person found this answer helpful.
0 comments No comments

1 additional answer

Sort by: Most helpful
  1. AI answer

    2026-05-21T17:38:25.5633333+00:00

    The existing formula is already written so it can be filled across and down as a normal (non-array) formula. To apply it to the whole range C3:O43, enter it once in C3, then fill it.

    Steps:

    1. Select cell C3 and enter the formula:
    =IF(ABS(MROUND($B3,C$2)-$B3)<=$B$2/2,ROUND($B3/C$2,0) & "=" & MROUND($B3,C$2),"")
    
    1. Use the fill handle to copy it across to column O:
      • With C3 selected, drag the fill handle (small square at the bottom-right corner of the cell) across to O3.
    2. Fill it down to row 43:
      • Select the filled range C3:O3.
      • Drag the fill handle down to row 43 (C43:O43).

    Because the formula uses:

    • $B3 (absolute column, relative row) and $B$2 (absolute row and column), and
    • C$2 (relative column, absolute row),

    it will adjust correctly as it is filled across and down. There is no need to convert it to an array/range formula; Excel’s relative/absolute references and fill behavior are designed for exactly this scenario.

    If desired, the Fill command can be used instead of dragging:

    1. Enter the formula in C3.
    2. Select C3:O3, then use Home → Fill → Right.
    3. Select C3:O43, then use Home → Fill → Down (or Ctrl+D).

    References:

    AI-generated content may be incorrect. Read our transparency notes for more information.

    Was this answer helpful?

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.