# Find values in a table greather than zero in a dynamic range of a table

##### New Member
Hello All,

i have a table like a following one (of course, mine is bigger) that is coming from a query:

 Countries 01/01/2020 01/02/2020 01/03/2020 01/04/2020 01/05/2020 Argentina 0 0 3000 2500 0 Australia 0 1000 0 1500 3000 Austria 1500 0 0 0 3000 Belgium 0 0 0 2000 0 France 1000 0 0 0 4000 Italy 0 3000 0 0 0

In the same file i have i have a cell, let's say B2. In B2 i'll insert all the time a different date.

What i'd like to do is to now, is obtain a new table where i'll have, for every single row (country):
• First value>0 starting from the date greater or equal to the one in B2
• The date (column header) where the value >0 has been found

Example:
If B2= 01/03/2020
my table will be:

 Country Value (>0 for dates >=B2) Date (only dates>= B2) Argentina 3000 01/03/2020 Australia 1500 01/04/2020 Austria 3000 01/05/2020 Belgium 2000 01/04/2020 France 4000 01/05/2020 Italy blank cause nothing>0 has been found for B2>=0 blank cause nothing>0 has been found for B2>=0

For the VALUE column i was thinking to apply the following:
• IF formula to check if the date in the column header is >=B2, and if this is true then check if the value is >0. IF both conditions are true then provide me the value. IF one of the conditions is false check the next column header/value.
For the DATE column i was thinking to apply the same as before but with a different order:
• check at first if a vale in the row is >0 and if this is true check if the date (column header) is >=B2. If both conditions provide me the column header, otherwise proceed with the next cell and repeat the operation
For both operations i don't know how to set up a formula that will repeat the operation to next cell in case one or both conditions will be false. Does anybody knows how to do it?

Anyway, this would be my approach. All the solutions to reach a layout like the second table will be really appreciated.

### Excel Facts

Highlight Duplicates
Home, Conditional Formatting, Highlight Cells, Duplicate records, OK to add pink formatting to any duplicates in selected range.

Replies
8
Views
179
Replies
3
Views
362
Replies
4
Views
146
Replies
0
Views
139
Replies
10
Views
265

1,130,169
Messages
5,640,544
Members
417,151
Latest member
ChickenTenderer

### 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.

### Which adblocker are you using?

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

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