+ Reply to Thread
Results 1 to 4 of 4

Counting instances in 2 columns and showing in 1 cell on another sheet

  1. #1
    Forum Contributor
    Join Date
    04-28-2004
    Location
    Norwich, England
    MS-Off Ver
    2010
    Posts
    119

    Counting instances in 2 columns and showing in 1 cell on another sheet

    Hi

    I am really stuck on where to begin with this... I've tried using IF and COUNTIF and VLOOKUP but I am getting very confused as to a) which one and b) how to do it if I knew which one!

    I have a spreadsheet for booking engineers to visit clients

    in the "client" sheet:
    Column H = Visit Booked For: (formatted as date)
    Column I = Engineer Name

    In the "engineer" sheet is a basic calendar - days down the side for April to July and the 6 engineer names as column titles

    What I would like to do is put a formula in all the relevant cells in the engineer sheet so that it looks at columns H and I in the client sheet and if there is a date in a "Visit Booked" cell it would then look at the cell next to it (column I) for the engineer name entered

    if the entered name matches the name at the top of the column in the hols sheet where the formula is then it should return how many times this happens (up to 3 visits per day) in the client sheet, to leave blank or zero if no visits booked

    So the final output would be - in the hols sheet how many visits each eningeer did on each day



    Many thanks in advance from a very confused blonde hippy!
    Attached Files Attached Files

  2. #2
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    Try

    =SUMPRODUCT(--(client!$G$2:$G$30=engineer!D$1)*(client!$F$2:$F$30=engineer!A2))

    VBA Noob
    _________________________________________


    Credo Elvem ipsum etian vivere
    _________________________________________
    A message for cross posters

    Please remember to wrap code.

    Forum Rules

    Please add to your signature if you found this link helpful. Excel links !!!

  3. #3
    Forum Contributor
    Join Date
    04-28-2004
    Location
    Norwich, England
    MS-Off Ver
    2010
    Posts
    119

    Thumbs up

    A million thank yous!

    Not only did it work (I had to copy it into notepad and then into excel or it went funny and turned into text rather than a formula) but also after a fair time looking at it, fiddling with it and adapting it to another spreadsheet as well, I even understand it now!

    Thank you again

    R

  4. #4
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    Glad it helped.

    Thanks for the feedback

    VBA Noob

+ 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