+ Reply to Thread
Results 1 to 12 of 12

Excel Diary Project Code Lookup

  1. #1
    Registered User
    Join Date
    09-03-2010
    Location
    London, England
    MS-Off Ver
    MS EXCEL 365 (v. 2111)
    Posts
    41

    Excel Diary Project Code Lookup

    Hi Guys

    I hope there's an excel genius out there that can help me with this one!?

    I've attached a spreadsheet which shows a diary broken down by the date (in each column) and the time by half hour (in the row). I work on various projects and want to automatically calculate, using formula, when each project (or project code) first appears (time and date) and when it last appears (time and date). I've provided some dummy data and an example of what i need returned.

    I hope this makes sense and also hope that someone can help me find a simple solution!

    Cheers!
    Attached Files Attached Files

  2. #2
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: Excel Diary Project Code Lookup

    Hi,

    You will need to unmerge your cells to allow this array formula** to be entered in B2:

    =INDEX($B$23:$L$23,MIN(IF($B$24:$L$56=$A2,COLUMN($B$24:$L$56)-MIN(COLUMN($B$24:$L$56))+1)))+INDEX($A$24:$A$56,MIN(IF($B$24:$L$56=$A2,ROW($B$24:$L$56)-MIN(ROW($B$24:$L$56))+1)))

    Copy down as required.

    Change the two occurrences of MIN(IF to MAX(IF and leave everything else the same for the formula in D2.

    Note that this formula will return a "midnight" time as the next day, e.g. for DFD41723 the last date will be given as 05/07/2014 00:00 and not 04/07/2014 00:00 as it technically appears in your sheet. It's arguable which is "correct", though let me know if you'd prefer it to be the latter.

    Regards


    **Array formulas are not entered in the same way as 'standard' formulas. Instead of pressing just ENTER, you first hold down CTRL and SHIFT, and only then press ENTER. If you've done it correctly, you'll notice Excel puts curly brackets {} around the formula (though do not attempt to manually insert these yourself).
    Click * below if this answer helped

    Advanced Excel Techniques: http://excelxor.com/

  3. #3
    Forum Contributor
    Join Date
    10-07-2011
    Location
    India, Mumbai
    MS-Off Ver
    Excel 2007
    Posts
    212

    Re: Excel Diary Project Code Lookup

    Please keep data vertical that will help you to automate.

    Thanks,
    Suhas

  4. #4
    Registered User
    Join Date
    09-03-2010
    Location
    London, England
    MS-Off Ver
    MS EXCEL 365 (v. 2111)
    Posts
    41

    Re: Excel Diary Project Code Lookup

    Thanks XOR, that's brilliant! Worked a treat!

    Thank you so much!!!

  5. #5
    Registered User
    Join Date
    09-03-2010
    Location
    London, England
    MS-Off Ver
    MS EXCEL 365 (v. 2111)
    Posts
    41

    Re: Excel Diary Project Code Lookup

    Thanks XOR, that's brilliant! Worked a treat!

    Thank you so much!!!

  6. #6
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: Excel Diary Project Code Lookup

    You're welcome!

  7. #7
    Forum Contributor
    Join Date
    10-07-2011
    Location
    India, Mumbai
    MS-Off Ver
    Excel 2007
    Posts
    212

    Re: Excel Diary Project Code Lookup

    Hi XOR LX,
    i really appreciate if you explain the logic behind this formula and it will helpful to us to build logic in future.
    Thanks in Advance
    Suhas

  8. #8
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: Excel Diary Project Code Lookup

    Forgive me, but I'd have to ask you first to clarify what you mean by "explain".

    I've had many similar requests in the past, only to find that, when I've given a detailed breakdown of the formulas and logic involved, the general reply has been along the lines of "Oh! Er thanks!" (i.e. "I never realised it would be so complicated!").

    I don't mean to condescend. It's simply that I'd rather not go into a detailed deconstruction if it's not really going to be of much use to you. That's why I ask what you expect in terms of an "explanation".

    Do you mean just the general concepts/logic behind the formula (i.e. a couple of lines)? Or perhaps a full deconstruction, including detailed explanations for each of the functions involved (this could take a whole page on its own in this forum)?

    What level of Excel do you currently have? Which parts of the formula do you already understand? Which don't you? What methods have you used so far in an attempt to deconstruct the formula?

    Regards

  9. #9
    Forum Contributor
    Join Date
    10-07-2011
    Location
    India, Mumbai
    MS-Off Ver
    Excel 2007
    Posts
    212

    Re: Excel Diary Project Code Lookup

    I want to understand only logic. i don't want to go into formula as we can write any formula if our logic is clear. just want to know what logic you used to find out first cell from Multipal column and rows? Because of arrey and you used 'IF' on multipal columns that i am not able to understand.
    I have very good in excel (Except VB).

  10. #10
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: Excel Diary Project Code Lookup

    Hi,

    This part:

    MIN(IF($B$24:$L$56=$A2,COLUMN($B$24:$L$56)-MIN(COLUMN($B$24:$L$56))+1))

    simply checks which of the entries in B24:L56 are equal to the value in A2 and, if so, returns their relative column position. For all of these, we then take the minimum (or maximum, for the other formula) and pass this column to the INDEX.

    The other part is precisely the same but that it returns a relative row number.

    Regards

  11. #11
    Forum Contributor
    Join Date
    10-07-2011
    Location
    India, Mumbai
    MS-Off Ver
    Excel 2007
    Posts
    212

    Re: Excel Diary Project Code Lookup

    Thanks Friend for your help.

  12. #12
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: Excel Diary Project Code Lookup

    You're welcome.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Add Appointments to Common(!) Diary. Working Macro for Personal Diary included.
    By Slone in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-10-2013, 12:50 PM
  2. [SOLVED] Function that concatenates multiple sub-project descriptions based on project code
    By markbpi in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 11-28-2012, 06:49 PM
  3. Emailing Excel Project with VB code
    By F3tz3r in forum Excel General
    Replies: 2
    Last Post: 11-15-2011, 10:10 AM
  4. Vba Excel code for inclusion in existing vba project
    By John Bortoli in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-15-2010, 05:20 PM
  5. If i entered any project code in sheet2 display all data of that project
    By koolguys4u in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 06-21-2009, 03:09 AM

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