Home » excel » Excel. Finding a specific casenumber in projectext and connecting employee name to it

Excel. Finding a specific casenumber in projectext and connecting employee name to it

Posted by: admin May 14, 2020 Leave a comment

Questions:

Image of the problem, can't post images directly yet

Hi people, my question seems really simple, but I cannot find an answer, even after searching. I need to find the casenumber in the projectext and connect the employee name to it. I’ll refer to the image numbers.

Nr. 1. Is the project text.
Example: D20160084 Piet K.A. – D1606076 – Bezwaar ingangsdatum uitkering – BIP 30 sep 2016 – 4ME6093

Nr. 2. Are the employees with their employee IDnumbers 01 to 07.

Nr. 3. I need to find a code to extract the casenumber, as seen in the first row. The casenumber D1606076 consists of three parts.

  • D16 = year 2016
  • 06 = employeenumber
  • 076 = number of the case

Nr. 4. I also need to find a code to extract the employee connected to the casenumber, as seen in the first row.

Anyone that can help?:)

  • I’m not sure if I can link to the workbook. Please let me know if it is not permitted. Link to workbook:

https://www.dropbox.com/s/17uv8ft9fyorlau/Searching%20for%20casenumber%20and%20employee%20number.xlsm?dl=0

How to&Answers:

I don’t know why you require vba for this but the following can easily be translated from worksheet functions to vba code.

The case number can be retrieved with,

=TRIM(MID(SUBSTITUTE(E10, "-", REPT(" ", LEN(E10))), LEN(E10), LEN(E10)))

The employee can be retrieved with,

=INDEX(G$1:G$7, MATCH(MID(E3, 4, 2)&".", F$1:F$7, 0))

enter image description here

Answer:

For the casenumber you could use in I10:

=MID(E10,FIND('-',E10)+2,8)

and for the employee in J10:

=INDEX($G$1:$G$7,MATCH(MID(I10,4,2)&'.',$F$1:$F$7,0))

drag down as needed.