+ Reply to Thread
Results 1 to 3 of 3

Summing a VLOOKUP

Hybrid View

  1. #1
    Registered User
    Join Date
    11-08-2010
    Location
    London
    MS-Off Ver
    Excel 2007
    Posts
    9

    Summing a VLOOKUP

    Hi There,

    I've been trying to add a vlookup formula to my worksheet but so far have been unable to...

    What I want it to do is look in the 6 cells to the left and add up points assigned to the letters.

    I.e. In H3 I want the total to be displayed. I have added the formula
    {=SUM(LOOKUP(B3:G3,{"D","M","P"},{3,2,1}))}

    This works fine unless a cell in the range of B3:G3 is left empty, then I get a #N/A error, so I altered the formula to {=SUM(LOOKUP(B3:G3,{"D","M","P","NA"},{3,2,1,0}))}
    however, If I have p p p p NA p, rather than it showing 5, i get 7

    If anyone can help me out it would be appreciated, hope the above made sense!

    Thanks,
    Jay
    Last edited by NBVC; 11-08-2010 at 03:04 PM.

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

    Re: Summing a VLOOKUP

    One way:

    =SUM(LOOKUP(IF(B3:G3<>"",B3:G3),{FALSE,"D","M","P"},{0,3,2,1}))

    confirmed with CTRL+SHIFT+ENTER not just ENTER
    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
    Registered User
    Join Date
    11-08-2010
    Location
    London
    MS-Off Ver
    Excel 2007
    Posts
    9

    Re: Summing a VLOOKUP

    Thanks so much

    Works perfectly!

+ 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