+ Reply to Thread
Results 1 to 7 of 7

Finding a person's specific Data with a formula

Hybrid View

  1. #1
    Registered User
    Join Date
    09-07-2012
    Location
    China
    MS-Off Ver
    Excel 2010
    Posts
    40

    Post Finding a person's specific Data with a formula

    I have a report sheet that is attached to multiple sheets.

    I am manually taking the data out for each week for each person.

    Is there a formula for it to automatically find the person's name and check what data is needed for that cell then go to the right sheet, find that person and find the specific data?

  2. #2
    Forum Expert
    Join Date
    06-09-2010
    Location
    Australia
    MS-Off Ver
    Excel 2013
    Posts
    1,714

    Re: Finding a person's specific Data with a formula

    Hi Kramm222
    I expect a formula or macro could be written, but we'd need more information, eg:
    • where should the formula look for the person's name (sheet name and range),
    • where is the data to be copied (e.g. column to the right of the name)
    • where is the data to be copied to

  3. #3
    Registered User
    Join Date
    09-07-2012
    Location
    China
    MS-Off Ver
    Excel 2010
    Posts
    40

    Re: Finding a person's specific Data with a formula

    Quote Originally Posted by NickyC View Post
    Hi Kramm222
    I expect a formula or macro could be written, but we'd need more information, eg:
    • where should the formula look for the person's name (sheet name and range),
    • where is the data to be copied (e.g. column to the right of the name)
    • where is the data to be copied to
    Here is the Document that I'm talking about.
    If you check under the "utilities Sheet" I wrote down as clearly as I can express what I need the formula to do.

    I know I might need to change some of the titles in my tables. but other than that what can i do?
    Attached Files Attached Files
    Last edited by Kram222; 09-10-2012 at 09:43 PM. Reason: Forgot the attachment

  4. #4
    Forum Expert
    Join Date
    06-09-2010
    Location
    Australia
    MS-Off Ver
    Excel 2013
    Posts
    1,714

    Re: Finding a person's specific Data with a formula

    Hi
    this macro might work
    to explain:

    it finds the last block of characters in the title cell (ie cell A53), which is the week number
    for each cell in the range "teachers" (the range in shee Utility with the names in), it:
    • finds the column with that name in row 2 of the sheet with the name name as the week number
    • finds the value row in 361 of the column to the right of that column
    • copies this value into the cell 3 columns to the right of the teacher's name in sheet "utility"

    Sub HoursFind()
    Dim Teachers As Range, TTell As Range, TName As String, WeekNum As Variant, arrNos As Variant, NameCol As Long, SearchRange As Range
    
    'find week number
    arrNos = Split(Sheets("Utility").Range("A53").Value, " ")
    WeekNum = Trim(arrNos(UBound(arrNos)))
    Set SearchRange = Sheets(WeekNum).Rows(2)
    
    Set Teachers = Sheets("Utility").Range("C55:c63")
    
    For Each Tcell In Teachers.Cells
        TName = Tcell.Value
        NameCol = Application.WorksheetFunction.Match(TName, SearchRange, 0)
        Tcell.Offset(0, 3).Value = Sheets(WeekNum).Rows(361).Columns(NameCol).Offset(0, 1).Value
    Next Tcell
    End Sub

  5. #5
    Registered User
    Join Date
    09-07-2012
    Location
    China
    MS-Off Ver
    Excel 2010
    Posts
    40

    Re: Finding a person's specific Data with a formula

    Thanks!

    This works perfectly!

    The only 3 issues are
    1) I'm not familiar enough with macro's yet to be able to understand the coding
    2)because of reason 1 I dont know how to adjust this to make it work for the other columns
    3) I was hoping more on finding out how to use a formula/function instead of a macro

    For anyone reading this:
    This Macro DOES WORK!!!
    It's just not what i was looking for.

  6. #6
    Forum Guru
    Join Date
    05-24-2011
    Location
    India
    MS-Off Ver
    365
    Posts
    2,243

    Re: Finding a person's specific Data with a formula

    Try this in F55

    =VLOOKUP("Total Hrs",INDIRECT("'"&RIGHT(A$53,4)&"'!B:ALL"),MATCH(C55,INDIRECT("'"&RIGHT(A$53,4)&"'!B2:ALL2"),0)+1,0)

    then copy down.
    Regards,
    Haseeb Avarakkan

    __________________________________
    "Feedback is the breakfast of champions"

  7. #7
    Registered User
    Join Date
    09-07-2012
    Location
    China
    MS-Off Ver
    Excel 2010
    Posts
    40

    Re: Finding a person's specific Data with a formula

    Quote Originally Posted by Haseeb A View Post
    Try this in F55

    =VLOOKUP("Total Hrs",INDIRECT("'"&RIGHT(A$53,4)&"'!B:ALL"),MATCH(C55,INDIRECT("'"&RIGHT(A$53,4)&"'!B2:ALL2"),0)+1,0)

    then copy down.

    This is what i was looking for.
    only issue is that I dont get it.
    could anyone explain the layout of this formula?

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1