Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Reference a range to a cell value

A better way to put it:

  1. I have many dataframes of variable column length, so xmax_pos = col_length.
  2. I want to apply a formula using this col_length as a range for each dataframe; if my range is bigger than my df, the formula won’t work.
=formula(A1:A"xmax_pos")

Is there a way for me to assign a range indirectly? Without manually modifying the range.

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

Yes, and you are quite close. Simply build a string and use that in an "indirect" function.

For example:

=indirect("A1") 

…will return the value in cell A1.

In your specific case, you would build the range reference like: "A1:A" & xmax_pos

I can’t be more specific than that due to lack of specifics in your question.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading