+ Reply to Thread
Results 1 to 6 of 6

lookup last cell with certain text and give heading of this cell

Hybrid View

  1. #1
    Registered User
    Join Date
    12-06-2010
    Location
    NI
    MS-Off Ver
    Excel 2003
    Posts
    8

    lookup last cell with certain text and give heading of this cell

    Hi all,
    I would appreciate help from anybody,
    for me huge problem, hopefully with simple solution.
    I have table of data for differnt types of absence... in first column are names of different people (so each person has one row of table) and then i have kind of calendar table where each column is one day of the month.. i need to search for S (for sick) and S1/2 (for half day sickness) for each person in whole month and to give me date of last sickness.

    I hope its clear enough to understand what i need. Thanx for help.
    Last edited by Dasha; 01-20-2011 at 11:45 AM.

  2. #2
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: lookup last cell with certain text and give heading of this cell

    It's not clear at this stage if you have other text strings within the table that are to be ignored and, if you do, whether or not they begin with S

    In theory - if you don't have other strings then:

    =LOOKUP(REPT("Z",255),$C2:$AG2,$C$1:$AG$1)
    format as Date
    where C2:AG2 holds days info for ee and row 1 the associated dates

    If you do have other strings to worry about (but not with S) then you might try:

    =LOOKUP(9.99E+307,SEARCH("S",$C2:$AG2),$C$1:$AG$1)
    format as Date
    If in doubt, post a sample file.

  3. #3
    Forum Guru (RIP) Marcol's Avatar
    Join Date
    12-23-2009
    Location
    Fife, Scotland
    MS-Off Ver
    Excel '97 & 2003/7
    Posts
    7,216

    Re: lookup last cell with certain text and give heading of this cell

    You would do best to post a sample workbook showing your Sheet Layout and perhaps Before and After examples.

    It should clearly illustrate your problem and not contain any sensitive data.

    Cheers

  4. #4
    Registered User
    Join Date
    12-06-2010
    Location
    NI
    MS-Off Ver
    Excel 2003
    Posts
    8

    Re: lookup last cell with certain text and give heading of this cell

    Hope this will help. Always need date of last time cell with SICK appears. Thanxs a lot
    Attached Files Attached Files

  5. #5
    Forum Guru (RIP) Marcol's Avatar
    Join Date
    12-23-2009
    Location
    Fife, Scotland
    MS-Off Ver
    Excel '97 & 2003/7
    Posts
    7,216

    Re: lookup last cell with certain text and give heading of this cell

    An addition to DonkeyOtes' second formula seems to work

    In AM5
    =IF(COUNTIF($B5:$AF5,"SICK")=0,"",LOOKUP(9.99E+307,SEARCH("S",$B5:$AF5),$B$4:$AF$4))
    I have also simplified your header formulae.
    Attached Files Attached Files
    Last edited by Marcol; 01-09-2011 at 10:45 AM. Reason: Better formula to handle no sick days
    If you need any more information, please feel free to ask.

    However,If this takes care of your needs, please select Thread Tools from menu above and set this topic to SOLVED. It helps everybody! ....

    Also
    اس کی مدد کرتا ہے اگر
    شکریہ کہنے کے لئے سٹار کلک کریں
    If you are satisfied by any members response to your problem please consider using the small Star icon bottom left of their post to show your appreciation.

  6. #6
    Registered User
    Join Date
    12-06-2010
    Location
    NI
    MS-Off Ver
    Excel 2003
    Posts
    8

    Re: lookup last cell with certain text and give heading of this cell

    thanks a lot to everybody. It really helped.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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