Return an specific value tied to a column

BBrider

New member
Joined
Dec 5, 2018
Messages
2
Reaction score
0
Points
0
Excel Version(s)
Professional Plus 2013
Hello guys

It is a little difficult to explain in the Title what I am looking for. Basically I have a massive set of data is the below format.

What I am looking for is return the week number of the associated cell that contains the first time an organization shows up. Better with an example...
The first time Company B shows up is in A10 so I want a formula or code that returns the value 31 (C10).

Let me know please! Thank you!

Capture.JPG
 

Attachments

  • Capture.PNG
    Capture.PNG
    9.3 KB · Views: 15
  • Capture.PNG
    Capture.PNG
    20.4 KB · Views: 12
  • Capture.JPG
    Capture.JPG
    54.4 KB · Views: 10
put thisfunction into a module and use it as user defined function on your excel.
parameter1 - company name to search for
parameter2 - select range of companies
parameter3 - select range of values (weeks)


Code:
Function fFindMin(sSearchStr As String, rgSearchStr As Range, rgValues As Range) As Variant


  Dim vStr As Variant
  Dim vVal As Variant
  Dim i As Integer
  
  findMin = Null
  vStr = rgSearchStr
  vVal = rgValues
  
  If UBound(vStr, 1) = UBound(vVal, 1) Then
    For i = LBound(vStr, 1) To UBound(vStr, 1)
      If rgSearchStr(i, 1) = sSearchStr Then
        findMin = vVal(i, 1)
        Exit For
      End If
    Next
  End If
End Function
 
Hi & welcome to the board.
How about

Excel 2013 32 bit
A
B
C
D
E
F
1
OrganizationMonthWeek
2
Company C
7​
29​
Company B
31​
3
Company A
7​
30​
4
Company A
7​
30​
5
Company A
7​
31​
6
Company B
7​
31​
7
Company B
7​
32​
Sheet: data

Formula in F2
=INDEX(C2:C7,MATCH(E2,A2:A7,0))
 
Last edited:
@Fluff

That is perfect... never thought it was that simple. Thanks!
 
Last edited by a moderator:
Glad to help & thanks for the feedback
 
Back
Top