searching an cellvalue in listobject depending on 2 search criteria

Renan

New Member
Joined
Aug 21, 2018
Messages
1
Hello together,

i am new here and i hope that someone with deeper Excel VBA knowledge can help me out with my problem.

I got an Listobject (see my example below) where i have some data. To be specific it has the columns year, week and value.

I need to write a function in VBA which has the input parameters year and week and the output parameter value.
It should search my Listobject like this:
1) search column YEAR for the given year (there are multiple entires up to 53, 1 Year can have 52 to 54 Weeks)
2) search in the columns that have this year listed for the week.
3) put the specific data from the column VALUE that belongs to the searched year and week. There can only be 1 match for this.

How can i realise that?


Example:

Function input: 2018, 4
Funktion output: D

YEARWEEKVALUE
2018
1A
20182B
20183C
20184D
20191E
20192F
20193G
20194H
20195I

<tbody>
</tbody>

Thank you very much!
 

Excel Facts

Remove leading & trailing spaces
Save as CSV to remove all leading and trailing spaces. It is faster than using TRIM().

Forum statistics

Threads
1,214,601
Messages
6,120,462
Members
448,965
Latest member
grijken

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