+ Reply to Thread
Results 1 to 11 of 11

Timeline Formula

  1. #1
    Forum Contributor
    Join Date
    06-16-2008
    Posts
    287

    Timeline Formula

    Hi, I have wrote a formula that will allow me to see how long a person has been in a particular between 07:30 to 09:30. My formula:

    =IF(AND(K$5>=$C6,K$5<$D6),$D6-$C6,"L")

    works for 1 field but not for anyothers and im not too sure why. If somebody could please help, would really appreciate it.

    Thanks in advance.

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Timeline Formula

    The formula structure looks fine. Post a sample workbook showing the formula NOT doing what it's supposed to so we can see what your data looks like.

    Click GO ADVANCED and use the paperclip icon to post up a desensitized copy of your workbook.
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  3. #3
    Forum Contributor
    Join Date
    06-16-2008
    Posts
    287

    Re: Timeline Formula

    Thanks for your response JBeaucaire. I have attached the workbook as required.
    Attached Files Attached Files

  4. #4
    Forum Expert teylyn's Avatar
    Join Date
    10-28-2008
    Location
    New Zealand
    MS-Off Ver
    Excel 365 Insider Fast
    Posts
    11,372

    Re: Timeline Formula

    Your conditions don't make a lot of sense. The way they're defined now, you will only get a value different from "L" if a time in C starts before the current column and ends after the current column. Is that what you want? Hard to tell.

    Can you describe in words what you would like to achieve?

  5. #5
    Forum Contributor
    Join Date
    06-16-2008
    Posts
    287

    Re: Timeline Formula

    teylyn, thanks for your response. Sorry, ill try to clear up what i am looking to do.

    The columns between K:BK should fill in the between values from column C to D. For example if humpty dumpty is on a call from 07:30 till 08:13 then col K and L should have a value of 00:15 and col M should have a value of 00:13.

    START | END | 07:30 | 07:45 | 08:00 | 08:15
    07:30 | 08:13 | 00:15 | 00:15 | 00:13 | L

    Hope that makes sense. Thanks once again for your help.

  6. #6
    Forum Expert teylyn's Avatar
    Join Date
    10-28-2008
    Location
    New Zealand
    MS-Off Ver
    Excel 365 Insider Fast
    Posts
    11,372

    Re: Timeline Formula

    if humpty dumpty is on a call from 07:30 till 08:13 then col K and L
    7:30 is in column E.

    Why would you want column K (9:00) and L (9:15) involved?

    Please be as precise with your specs as you want the helpers here to be precise with their suggestions.

    I suggest you start over and refer to the file you posted instead of sending us off on a wild goose chase.

  7. #7
    Forum Contributor
    Join Date
    06-16-2008
    Posts
    287

    Re: Timeline Formula

    teylyn, apologies meant to say E, F and G instead of K, L and M. I had deleted some columns on my version hence the confusion.

  8. #8
    Forum Expert teylyn's Avatar
    Join Date
    10-28-2008
    Location
    New Zealand
    MS-Off Ver
    Excel 365 Insider Fast
    Posts
    11,372

    Re: Timeline Formula

    confused. Upload a worksheet with the expected results filled in manually.

  9. #9
    Forum Contributor
    Join Date
    06-16-2008
    Posts
    287

    Re: Timeline Formula

    teylyn, sorry to confuse you. As required, i have attached the expected results sheet. Hope this makes more sense. thanks once again.
    Attached Files Attached Files

  10. #10
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675

    Re: Timeline Formula

    Try using this formula in E3 copied across and down

    =MAX(0,MIN(E$2+"0:15",$D3)-MAX(E$2,$C3))

    That will give a zero value in most cells - you can use a custom format like this to display that as "L"

    hh:mm;;"L"

    Then conditional formatting to format the zero values blue, if you want, see attached

    If you want an actual "L" in the cell delivered by the formula rather than formatting then you could use this revised formula

    =IF(OR($C3>=E$2+"0:15",$D3<=E$2),"L",MIN(E$2+"0:15",$D3)-MAX(E$2,$C3))
    Attached Files Attached Files
    Audere est facere

  11. #11
    Forum Contributor
    Join Date
    06-16-2008
    Posts
    287

    Re: Timeline Formula

    daddylonglegs, thanks, i will have a look and see if that works.

+ 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