+ Reply to Thread
Results 1 to 16 of 16

VLOOKUP or SUMIF or ???

  1. #1
    Registered User
    Join Date
    09-22-2009
    Location
    USA
    MS-Off Ver
    Excel 2007
    Posts
    25

    Question VLOOKUP or SUMIF or ???

    I have a workbook containing 2 tabs.

    Tab 1 has columnar data with column A containing locations; however, each location may be listed multiple times on different lines - once for each piece of equipment at that location. Tab 1, column B has a piece of equipment listed. Tab 1, column C has a price associated with the piece of equipment in column B.

    Tab 2 contains contains columnar data with column A containing locations. I need to populate Tab 2, column B with the sum of all equipment associated with the location in column A.

    I have used VLOOKUP to try and find matches for the lookup_value in Tab 2, column A, then return the value of the price from Tab 1, column C.

    Problems have been that it returns only the first instance of the location data, not a sum of all. I know the formula is missing something, but cannot ID it.

    Formula as used:

    =VLOOKUP(B4,'Tab 1'!$I$4:$AI$461,3)

    B4 is the column on Tab B that contains all of the locations (lookup_table)
    Tab 1 I4 thru AI461 is the table_array where all locations are listed
    3 is the col_index_num indicating that the price is in the 3rd column over

    If this is not enough data to ealuate, please advise.

    I'm stuck and in need of immediate assistance to meet a deadline. Any assitance is much appreciated, thanks!

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

    Re: VLOOKUP or SUMIF or ???

    Try perhaps,

    =Sumif('Tab 1'!$I$4:$I$461,B4,'Tab 1'!$K$4:$K$461)
    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
    09-22-2009
    Location
    USA
    MS-Off Ver
    Excel 2007
    Posts
    25

    Re: VLOOKUP or SUMIF or ???

    Tried that last night. It only returns zeros. VLOOKUP has done the best; however, it only grabs the first occurance.

  4. #4
    Valued Forum Contributor Shijesh Kumar's Avatar
    Join Date
    05-26-2008
    Location
    Bangalore / India
    MS-Off Ver
    2000
    Posts
    717

    Re: VLOOKUP or SUMIF or ???

    can u post a sample spreadsheet (without sensitive data)

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

    Re: VLOOKUP or SUMIF or ???

    Your column K is probably text instead of numbers...

    try selecting column K and going to Data|Text to Columns and clicking Finish.

    Does that fix it?

  6. #6
    Registered User
    Join Date
    09-22-2009
    Location
    USA
    MS-Off Ver
    Excel 2007
    Posts
    25

    Re: VLOOKUP or SUMIF or ???

    I've also used:

    =SUMIF('Tab 1'!$I4:$I461,B4,'Tab 2'!$AI$4:$AI461)

    It works equally as well as the VLOOKUP. They both grab the first occurance of a location only. I need something to get them all.

    I noticed that the SUMIF also grabs the wrong amount once in a column of a dozen lines. Strange, as it got all the others right.

  7. #7
    Registered User
    Join Date
    09-22-2009
    Location
    USA
    MS-Off Ver
    Excel 2007
    Posts
    25

    Re: VLOOKUP or SUMIF or ???

    In my samples:

    VLOOKUP: B = text, I = text, AI = number

    SUMIF: I = text, B = text, AI = number

  8. #8
    Registered User
    Join Date
    09-22-2009
    Location
    USA
    MS-Off Ver
    Excel 2007
    Posts
    25

    Re: VLOOKUP or SUMIF or ???

    Quote Originally Posted by NBVC View Post
    Your column K is probably text instead of numbers...

    try selecting column K and going to Data|Text to Columns and clicking Finish.

    Does that fix it?

    I don't understand 'going to Data|Text'...???

  9. #9
    Registered User
    Join Date
    09-22-2009
    Location
    USA
    MS-Off Ver
    Excel 2007
    Posts
    25

    Re: VLOOKUP or SUMIF or ???

    Quote Originally Posted by Shijesh Kumar View Post
    can u post a sample spreadsheet (without sensitive data)

    Trying to figure a way to do this.

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

    Re: VLOOKUP or SUMIF or ???

    Quote Originally Posted by dawgfan View Post
    I don't understand 'going to Data|Text'...???
    Select the column of "numbers" and go to the Data Menu at the top and select Text To Columns. or ALT+D+E, then click Finish.

  11. #11
    Valued Forum Contributor Shijesh Kumar's Avatar
    Join Date
    05-26-2008
    Location
    Bangalore / India
    MS-Off Ver
    2000
    Posts
    717

    Re: VLOOKUP or SUMIF or ???

    Scroll down... below submit reply button

    u will see manage attachemnt button click on that and upload a file

  12. #12
    Registered User
    Join Date
    09-22-2009
    Location
    USA
    MS-Off Ver
    Excel 2007
    Posts
    25

    Re: VLOOKUP or SUMIF or ???

    Quote Originally Posted by NBVC View Post
    Select the column of "numbers" and go to the Data Menu at the top and select Text To Columns. or ALT+D+E, then click Finish.

    Don't see the value of converting numbers in a text to column wizard? I'm obviously missing something.

  13. #13
    Registered User
    Join Date
    09-22-2009
    Location
    USA
    MS-Off Ver
    Excel 2007
    Posts
    25

    Re: VLOOKUP or SUMIF or ???

    Quote Originally Posted by Shijesh Kumar View Post
    Scroll down... below submit reply button

    u will see manage attachemnt button click on that and upload a file
    Yes, thanks. I meant how to use my sensitive data...

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

    Re: VLOOKUP or SUMIF or ???

    Quote Originally Posted by dawgfan View Post
    Don't see the value of converting numbers in a text to column wizard? I'm obviously missing something.
    Well, if you know you have exact matches in column I and they are just not adding up the numbers in AI, then chances are the numbers in AI are really formatted as text... the Text-to-columns fixes that... did you even try?

  15. #15
    Registered User
    Join Date
    09-22-2009
    Location
    USA
    MS-Off Ver
    Excel 2007
    Posts
    25

    Re: VLOOKUP or SUMIF or ???

    Quote Originally Posted by NBVC View Post
    Well, if you know you have exact matches in column I and they are just not adding up the numbers in AI, then chances are the numbers in AI are really formatted as text... the Text-to-columns fixes that... did you even try?
    now I see. No, did not try as this is a proposal and I cannot afford to mess anything up experimenting. I'll make a copy any play. It has benn suggested by colleagues that a formatting thing may be going on in the tables of data, which are huge and may have been derived from various sources including Word to Excel historically. You may be on the right track. Thanks again.

  16. #16
    Registered User
    Join Date
    09-22-2009
    Location
    USA
    MS-Off Ver
    Excel 2007
    Posts
    25

    Re: VLOOKUP or SUMIF or ???

    I gave up and added a subtotal to the table I was pulling cost from and used the SUMIF formula rather than the VLOOKUP.

+ 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