Search code examples
excelrangecellexcel-indirect

Excel - Inserting Cell Values into Ranges


I'm having problems inserting the value of a cell into a range. Right now I have:

=M3/SUM(M$3:M$13)

What I need is to be able to insert the value of another cell into that range, like:

=M3/SUM(M$A1:M$B1)

I have spent some time with the indirect function but I can't seem to get the syntax right. Does anyone know the correct syntax? Is indirect even the best/easiest/cleanest way to achieve my goal?


Solution

  • This will do what you want:

    =M3/SUM(INDIRECT("M" & $A$1 & ":M" & $B$1))
    

    Not sure if you want A1 and B1 absoluted so I did it anyway.