Excel - How to use the value of a cell as the row value of another cell?

StackOverflow https://stackoverflow.com/questions/19471912

  •  01-07-2022
  •  | 
  •  

سؤال

Here is my problem:

I have a cell (V4) containing the value 444. I want to use this value in the formula of another cell (M12) in the following way. I want the formula to be equivalent to =MIN(L12:L444) but instead of 444 I want to refer to cell V4 which contains the value 444. But when I type in =MIN(L12:L(V4)) it obviously doesnt work so how do I do it? Sorry if I didn't explain it very well. :S

هل كانت مفيدة؟

المحلول 2

INDIRECT will work and is closest to the solution you described, but I prefer OFFSET, which uses proper references. (For example, if you insert a column in the sheet before L, INDIRECT will break while OFFSET will just update its reference as expected.

Two ways to go with OFFSET:

1 - Start at L$1 and go down $V$4-1 rows. (This will work with $V$4 as you've defined it now.)

=MIN(L12:OFFSET(L$1,$V$4-1,0))

2 - In $V$4, provide the height of the range you want.

=MIN(OFFSET(L12,0,0,$V$4,0))

It's hard to make suggestions without more context, but I'm sure you can tweak one of these patterns to meet your needs.

نصائح أخرى

Would this work for you:

=MIN(L12:INDIRECT("L"&$V$4))

From: Excel - INDIRECT and Using the value in a cell as a cell reference in a formula?

I am not sure if you are trying to include all of the values in 1 column and then on non-contiguous cell. If so, it should look like = Min(L12:L444,V4) . The L12:L444 looks at the value in every cell in the L column from 12 - 444.
So you can check individual cell (A3, D15, Q54) with commas, or a range of cells (A3:Z54) with a colon. Or a range and a specific cell like above =Min(L12:L444, V4).

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top