+ Reply to Thread
Results 1 to 20 of 20

Lookup problem

Hybrid View

  1. #1
    Valued Forum Contributor squiggler47's Avatar
    Join Date
    02-17-2009
    Location
    Littleborough, UK
    MS-Off Ver
    Excel 3.0 to 2007+2010! (couldnt get 2.1 working)
    Posts
    1,013

    Lookup problem

    I was wondering if you have any ideas on this

    See attached sheet!

    I want to take only the D1 to D19 values and look them up in the table in row A then sum the values!, the problem is it has to ignore Numbers and Other values not starting with a D! These should total up in row 25 under each date!

    The same with column K it should total the hours for D values Horizontaly!

    To add a twist D1-D99 lookup column b in the table, D101-D199 lookup column C, D201-D299 lookup column D.

    The Sheet is in Excel 2002 format!

    Thanks

    Darren!
    Attached Files Attached Files
    Last edited by squiggler47; 03-11-2009 at 11:24 AM. Reason: Forgot Attachment!!!!!

  2. #2
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Lookup problem

    A little confusing...

    You row/column references in your description above don't seem to match your spreadsheet (e.g. "To add a twist D1-D99 lookup column b in the table, D101-D199 lookup column C, D201-D299 lookup column D" ... column B is text, columns C-E have numbers.. but the titles don't match your description above).

    Also what does this really refer to? : I want to take only the D1 to D19 values and look them up in the table in row A

    is it Column A or Row 1 or what?

    Please also reattach your sheet with some actual results you are expecting and explain where they came from.
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

  3. #3
    Valued Forum Contributor squiggler47's Avatar
    Join Date
    02-17-2009
    Location
    Littleborough, UK
    MS-Off Ver
    Excel 3.0 to 2007+2010! (couldnt get 2.1 working)
    Posts
    1,013

    Re: Lookup problem

    Ok, i will try to explain

    Cell M5:M23 contains the Duties worked on monday which can be D1,D2..D19 (thats a text Value) which refers to the table in columns B-E to get the hours for that particular duty!

    These cells can also have a value (if someone does extra or none duty work!)

    Or Hol,Sick (perhaps more)

    So what i want to do for each column and row (m5:s23)is :-

    find all cells in that column/row with text beginning with "D", look it up and total the value in column C:-

    EG Row 5 contains D1,8,8,Sick,8,Hol,Hol

    i want to lookup D1 in b5:b41, get the corresponding value in c5:c41 giving a result of 10

    in column 2 we have D2,d3,d3,d3,d3,d101,d3

    So i need values for D2=5,d3=8,d3=8,d3=8,d3=8,D101 - ignore for now,d3=8 giving a total of 44

    I also need this vertically as well, since I need to verify that all duties have been accounted for!

    the twist is that (these are values not cells) D101 = D1 in Saturday,D201=d1 in sunday/holidays
    Last edited by squiggler47; 03-11-2009 at 09:27 AM.

  4. #4
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Lookup problem

    Before we go to the 'twist', does this formula in H5, copied down take care part of the need?

    =SUM($M5:$S5)+SUMPRODUCT(($M5:$S5=$B$5:$B$23)*$C$5:$C$23)

  5. #5
    Valued Forum Contributor squiggler47's Avatar
    Join Date
    02-17-2009
    Location
    Littleborough, UK
    MS-Off Ver
    Excel 3.0 to 2007+2010! (couldnt get 2.1 working)
    Posts
    1,013

    Re: Lookup problem

    Yes, apart from it only needs to sum D values, not numbers!

  6. #6
    Valued Forum Contributor squiggler47's Avatar
    Join Date
    02-17-2009
    Location
    Littleborough, UK
    MS-Off Ver
    Excel 3.0 to 2007+2010! (couldnt get 2.1 working)
    Posts
    1,013

    Re: Lookup problem

    It also needs to reference the whole table, incase duties are added, and do that vertically as well!

  7. #7
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Lookup problem

    So then just:

    =SUMPRODUCT(($M5:$S5=$B$5:$B$23)*$C$5:$C$23)

    Now, what's next?

  8. #8
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Lookup problem

    Just need to sum the columns and its good to go
    Are you asking me this? If so, please elaborate.

    If not, please mark thread as [Solved]
    Last edited by NBVC; 03-11-2009 at 10:49 AM.

  9. #9
    Valued Forum Contributor squiggler47's Avatar
    Join Date
    02-17-2009
    Location
    Littleborough, UK
    MS-Off Ver
    Excel 3.0 to 2007+2010! (couldnt get 2.1 working)
    Posts
    1,013

    Re: Lookup problem

    Yes, cant figure out how to get the formulas to work on the columns, i just get value errors :-(

  10. #10
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Lookup problem

    If you are talking about M25:S25, then try:

    =SUMPRODUCT((M$5:M$23=$B$5:$B$23)*$C$5:$C$23)+SUMPRODUCT((TRANSPOSE(M$5:M$23)="D"&MID($B$5:$B$23,2,3)+100)*$D$5:$D$23)+SUMPRODUCT((TRANSPOSE(M$5:M$23)="D"&MID($B$5:$B$23,2,3)+200)*$E$5:$E$23)
    in M25. This one has to be confirmed with CTRL+SHIFT+ENTER not just ENTER, because of the TRANSPOSE() function...

    Then copy it across to S25.

  11. #11
    Valued Forum Contributor squiggler47's Avatar
    Join Date
    02-17-2009
    Location
    Littleborough, UK
    MS-Off Ver
    Excel 3.0 to 2007+2010! (couldnt get 2.1 working)
    Posts
    1,013

    Re: Lookup problem

    Still doesnt work, same problem I was having I attached current state of sheet!

    It doesnt seem to match the Duplicates
    Attached Files Attached Files

  12. #12
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Lookup problem

    I guess we have to transpose the first set also....I missed that one.

    try:

    =SUMPRODUCT((TRANSPOSE(N$5:N$23)=$B$5:$B$23)*$C$5:$C$23)+SUMPRODUCT((TRANSPOSE(N$5:N$23)="D"&MID($B$5:$B$23,2,3)+100)*$D$5:$D$23)+SUMPRODUCT((TRANSPOSE(N$5:N$23)="D"&MID($B$5:$B$23,2,3)+200)*$E$5:$E$23)

    confirmed with CTRL+SHIFT+ENTER

  13. #13
    Valued Forum Contributor squiggler47's Avatar
    Join Date
    02-17-2009
    Location
    Littleborough, UK
    MS-Off Ver
    Excel 3.0 to 2007+2010! (couldnt get 2.1 working)
    Posts
    1,013

    Thumbs up Re: Lookup problem

    Lol, yes missing transpose,

    Thanks for all your help, I'm still getting my head around the SumProduct, strangely the books I have dont mention it!

    I'm hoping my wife will be happy that I am making her job easier!

    Regards

    Darren

  14. #14
    Valued Forum Contributor squiggler47's Avatar
    Join Date
    02-17-2009
    Location
    Littleborough, UK
    MS-Off Ver
    Excel 3.0 to 2007+2010! (couldnt get 2.1 working)
    Posts
    1,013

    Re: Lookup problem

    One more slight problem, I was trying to make the ranges dynamic to allow for new values, it doesnt seem to like name ranges in the formula!

    Any ideas?

  15. #15
    Valued Forum Contributor squiggler47's Avatar
    Join Date
    02-17-2009
    Location
    Littleborough, UK
    MS-Off Ver
    Excel 3.0 to 2007+2010! (couldnt get 2.1 working)
    Posts
    1,013

    Re: Lookup problem

    I need to allow for the list in rows B:E to expand and contract, I found one problem, if i can get the ranges to work dynamic then I should be good, going to try again!!!

  16. #16
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Lookup problem

    Dynamic in what way?

  17. #17
    Valued Forum Contributor squiggler47's Avatar
    Join Date
    02-17-2009
    Location
    Littleborough, UK
    MS-Off Ver
    Excel 3.0 to 2007+2010! (couldnt get 2.1 working)
    Posts
    1,013

    Re: Lookup problem

    I think i got it for some reason my dynamic ranges didnt work first time, I redefined them now and all is good!

    Again your help is much appreciated!

+ 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