Searching datatable for values and printing value in other sheet.

bioplz

New Member
Joined
Dec 1, 2021
Messages
15
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

Can you sort left to right?
To sort left-to-right, use the Sort dialog box. Click Options. Choose "Sort left to right"

Forum statistics

Threads
1,214,641
Messages
6,120,685
Members
448,977
Latest member
dbonilla0331

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