Dynamic named range using a range within a range

Nox000

New Member
Joined
Feb 10, 2015
Messages
1
I have the following worksheet:


Code:
       A         B         C         D          E
      +-----+-----------+---------+--------+-------------+
    1 |FALSE|Lot ABC123 |Product 1|Used qty|remaining qty|
      +-----+-----------+---------+--------+-------------+
    2 |TRUE |Lot ABC321 |Product 2|Used qty|remaining qty|
      +-----+-----------+---------+--------+-------------+
    3 |TRUE |Lot ABC456 |Product 1|Used qty|remaining qty|
      +-----+-----------+---------+--------+-------------+
    4 |FALSE|Lot ABC111 |Product 3|Used qty|remaining qty|
      +-----+-----------+---------+--------+-------------+
    5 |     |           |         |        |             |
      +-----+-----------+---------+--------+-------------+
    6 |     |           |         |        |             |
      +-----+-----------+---------+--------+-------------+

with the purpose to create a drop-down list in another worksheet, I've created a dynamic named range for the column C that picks all cells up to the last used one with
Code:
=OFFSET($C$1,0,0,COUNTA($C:$C)-0,1)

Now, Is it possible to create the same range but only with the products that are still available (E>0) ?
Tried with
Code:
=IF($E1>0,OFFSET($C$1,0,0,COUNTA($C:$C)-0,1),"")
but ofc it didn't work.

Since the values selected from the drop-down list are used in a different worksheet to fetch values found in column B of this worksheet, a further step would be to tell excel that once "E1=0" it should interpret any new "product1" as the product1 in C3 instead of C1, and fetch B3 instead of B1
I guess this last step will require a bit of VBA...

Any help would be appreciated!
Thanks!
 

Excel Facts

Excel Can Read to You
Customize Quick Access Toolbar. From All Commands, add Speak Cells or Speak Cells on Enter to QAT. Select cells. Press Speak Cells.

Forum statistics

Threads
1,215,110
Messages
6,123,146
Members
449,098
Latest member
Doanvanhieu

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top