Searching datatable for values and printing value in other sheet.

bioplz

New Member
Joined
Dec 1, 2021
Messages
4
Office Version
  1. 2019
Platform
  1. Windows
I have a datatable and another sheet that contains values for specific tests. I would like the Sheet with the specific tests to search through the datatable for those specific tests and return a -1 if certain conditions are met.

So, If sheets("Data") column c value = 7, and if column L value = "" then if in string in column M = "12.1" then Sheets("Train7").Range("E3").value = "-1"

I would need to search dozens of rows to find dozens of tests. In column C there will only be 1 value (7 in this example). In column L the value will either be a data or empty. In column M there will be some number of values in a string (12.1, 12.2, 12.3). And on the other sheet with the values stored I would like to return "-1" for 12.1 in E3, "-1" for 12.2 in E4, etc.

This picture is the table that the values will be stored.
example table.png

and this picture is where the data is stored.
example data.png
 

Excel Facts

What is the fastest way to copy a formula?
If A2:A50000 contain data. Enter a formula in B2. Select B2. Double-click the Fill Handle and Excel will shoot the formula down to B50000.
Master Excel Bundle

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

Forum statistics

Threads
1,152,110
Messages
5,768,150
Members
425,458
Latest member
Jaspal1996

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
Top