Representing an Excel cell address in a formula using string values ​​from other Excel cells?

Let's say I want to get an answer to this type formula = SUM(startcell:endcell), but the components startcelland change endcell.

So instead of using it C1directly in the formula to represent the values ​​in the cell C1, I want to be able to use all the values ​​and B1, B2, and B3to build something that can represent C1the formula?

Perhaps the best way to ask the question is: Does Excel have something like Python eval()?

alt text

+3
source share
4 answers

alt text

-1
source

Excel ... ,

alt text

!

+8

, , . value = ADDRESS (row_number, column_number, absolute_number_flag, bool_A1Style, sheet_text).

, : - Sheet1! R1C3 = (B3, B2, FALSE, B1) - Sheet1! C1 = ADDRESS (B3, B2, TRUE, B1) = ADDRESS (B3, B2,, B1)

INDIRECT .

, , sum(), .

eg. If you added the value 5 to cells C3 and C4 of your example, to specify a row and column for your final cell, you could have the formula = ADDRESS (B4, B3 ,, B2) & ":" & ADDRESS (C4, C3), which will return "Sheet1!"! $ C $ 1: $ E $ 5

I can’t post images, so hopefully this makes sense in the text!

+1
source

You can try

formula = SUM(INDIRECT(B1),INDIRECT(B2),INDIRECT(B3))

And do more tests to see if you can work with ranges

0
source

Source: https://habr.com/ru/post/1779326/


All Articles