+ Reply to Thread
Results 1 to 13 of 13

Comparing items and calculating prices

Hybrid View

drewship Comparing items and... 05-05-2009, 08:36 AM
NBVC Re: Comparing items and... 05-05-2009, 08:49 AM
DonkeyOte Re: Comparing items and... 05-05-2009, 08:50 AM
drewship Re: Comparing items and... 05-05-2009, 09:04 AM
drewship Re: Comparing items and... 05-05-2009, 09:13 AM
drewship Re: Comparing items and... 05-05-2009, 09:16 AM
NBVC Re: Comparing items and... 05-05-2009, 09:13 AM
  1. #1
    Forum Contributor
    Join Date
    04-30-2009
    Location
    USA
    MS-Off Ver
    Excel 2016
    Posts
    496

    Comparing items and calculating prices

    Hello all,
    I thought I was beginning to understand some of the functions and formulas but I am still at a loss.

    I have attached a sample spreadsheet for reference.

    What I am trying to do is eliminate column 'J' on the Distribution tab. I want to use column 'C' on the Totals tab to calculate the subtotal based on matching the products on the Distribution tab in column 'E' with the Products list on the Totals tab in column 'A'. Once the match is made, I need to multiply the associated price in column 'C' on the Totals tab and the associated quantity in column 'F' on the Distribution tab with the result going in column 'K' on the Distribution tab.

    I tried

    =VLOOKUP(E:E,Totals!$A:$A,3,TRUE)*F:F

    and

    =SUMPRODUCT(SUMIF(E3,Totals!A3,F3)*Totals!C3)

    but neither works and I do not know what else to try. Any help would be appreciated.

    Thanks in advance,
    Andrew
    Attached Files Attached Files
    Last edited by drewship; 05-05-2009 at 01:33 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: Comparing items and calculating prices

    Try:

    =VLOOKUP(E3,Totals!$A$3:$E$18,3,FALSE)*F3

    copied down
    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
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Comparing items and calculating prices

    Do you mean

    K3: =F3*VLOOKUP(E3,Totals!A:C,3,0)

  4. #4
    Forum Contributor
    Join Date
    04-30-2009
    Location
    USA
    MS-Off Ver
    Excel 2016
    Posts
    496

    Re: Comparing items and calculating prices

    Thanks NBVC!!! I thought after matching the product in 'A' on the Totals tab, it would automatically associate it with the correct price. Now I see (and can hopefully remember) that all the cells in the list have to be defined to make the correct association.

    In the formula, I tried 'True' and you used 'False' for the range_lookup. Can you explain what this actually doing?

    Thanks again,
    Andrew

  5. #5
    Forum Contributor
    Join Date
    04-30-2009
    Location
    USA
    MS-Off Ver
    Excel 2016
    Posts
    496

    Re: Comparing items and calculating prices

    Thanks DonkeyOte. Your formula makes it easy to add data to the lookup list without changing the code!!

    Andrew

  6. #6
    Forum Contributor
    Join Date
    04-30-2009
    Location
    USA
    MS-Off Ver
    Excel 2016
    Posts
    496

    Re: Comparing items and calculating prices

    Thanks NBVC. 'False' looks like the best way to go for anything I need to do.

    Andrew

  7. #7
    Forum Contributor
    Join Date
    04-30-2009
    Location
    USA
    MS-Off Ver
    Excel 2016
    Posts
    496

    Re: Comparing items and calculating prices

    Another question for you. I need the calculation to perpetuate down the entire column. Cells that cannot be calculated yet (because the source cells are blank) display #N/A. I tried conditional formatting to format the cell to use white text to hide the #N/A but that does not work. I looked on the Options menu but did not see anything that would hide these. Is there a way to hide #N/A with VBA?

    Thanks
    Andrew

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

    Re: Comparing items and calculating prices

    You should have a look at the Excel Help files for the Vlookup function... it explains the difference there well.

    Basically, the False makes Vlookup look for exact matches no matter what sort order you lookup table is in... the True depends on the first column in the lookup table being sorted in Ascending order, then it looks for the closest match.. and returns the corresponding item.

+ 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