+ Reply to Thread
Results 1 to 9 of 9

Multiply Range by Lookup Value Using Evaluate

  1. #1
    Forum Contributor
    Join Date
    02-20-2007
    MS-Off Ver
    2003 & 2007
    Posts
    299

    Multiply Range by Lookup Value Using Evaluate

    Not sure it's possible, but I was trying to see if I could multiply a range of values by a lookup value using Evaluate to avoid writing a loop. Here is what I have, it doesn't work. It executes, but it appears to only multiply the range by the first value in the lookup table.

    Please Login or Register  to view this content.
    If I take out the IF(ROW I get the same answer. This code produces same result as above. Is it possible to do what I'm trying to do??

    Please Login or Register  to view this content.

  2. #2
    Forum Expert dflak's Avatar
    Join Date
    11-24-2015
    Location
    North Carolina
    MS-Off Ver
    365
    Posts
    7,920

    Re: Multiply Range by Lookup Value Using Evaluate

    Attach a sample workbook. Make sure there is just enough data to demonstrate your need. Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show the process you're trying to complete or automate. Make sure your desired results are shown, mock them up manually if necessary.

    Remember to desensitize the data.

    Click on GO ADVANCED and then scroll down to Manage Attachments to open the upload window.
    One spreadsheet to rule them all. One spreadsheet to find them. One spreadsheet to bring them all and at corporate, bind them.

    A picture is worth a thousand words, but a sample spreadsheet is more likely to be worked on.

  3. #3
    Forum Contributor
    Join Date
    02-20-2007
    MS-Off Ver
    2003 & 2007
    Posts
    299

    Re: Multiply Range by Lookup Value Using Evaluate

    Example file now attached.
    Attached Files Attached Files

  4. #4
    Forum Expert dflak's Avatar
    Join Date
    11-24-2015
    Location
    North Carolina
    MS-Off Ver
    365
    Posts
    7,920

    Re: Multiply Range by Lookup Value Using Evaluate

    Can you assure that the years in column B will always match, row by row, the years in column J?

  5. #5
    Forum Contributor
    Join Date
    02-20-2007
    MS-Off Ver
    2003 & 2007
    Posts
    299

    Re: Multiply Range by Lookup Value Using Evaluate

    No. They won't always match. In Fact, I was hoping that if there was a solution, it could be converted to apply to a situation where the Original values are structured horizontally even. The Lookup table will always be vertical.

  6. #6
    Forum Expert dflak's Avatar
    Join Date
    11-24-2015
    Location
    North Carolina
    MS-Off Ver
    365
    Posts
    7,920

    Re: Multiply Range by Lookup Value Using Evaluate

    In that case, I really do not see an option other than looping. Or you can certainly use helper columns.

    If you go with a vertical structure, you can use Excel tables to copy down the formulas automatically.

    If you go horizontally, you'll have to copy over the formulas manually.

    Which way would you like to go? Vertically with helper columns, horizontally with manual copy of formulas, VBA?

  7. #7
    Forum Contributor
    Join Date
    02-20-2007
    MS-Off Ver
    2003 & 2007
    Posts
    299

    Re: Multiply Range by Lookup Value Using Evaluate

    I'll just go VBA. I can handle writing the code for the loop. Thanks for checking.

  8. #8
    Forum Expert
    Join Date
    11-24-2013
    Location
    Paris, France
    MS-Off Ver
    Excel 2003 / 2010
    Posts
    9,831

    Cool Hi ! Try this !


    No need a loop just using a temp column :

    PHP Code: 
    Sub Demo1()
        
    With Sheet2.[D3:D19]
            .
    Formula "=VLOOKUP(B3,$J$3:$K$19,2)*C3"
            
    .Offset(, -1).Value = .Value
            
    .Clear
        End With
    End Sub 
    Do you like it ? So thanks to click on bottom left star icon « Add Reputation » !

  9. #9
    Forum Guru xlnitwit's Avatar
    Join Date
    06-27-2016
    Location
    London
    MS-Off Ver
    Windows: 2010; Mac: 16.13 (O365)
    Posts
    7,085

    Re: Multiply Range by Lookup Value Using Evaluate

    For this particular case, since you have an entry for each year and the table is sorted, you might use
    Please Login or Register  to view this content.
    Don
    Please remember to mark your thread 'Solved' when appropriate.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Evaluate Mid in a range
    By mgblair in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 11-13-2015, 06:57 PM
  2. Evaluate a Range
    By TuFatSnaka in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 11-27-2013, 04:57 PM
  3. Lookup and Multiply Result
    By StephenSmith in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 09-06-2013, 01:31 PM
  4. Excel can't evaluate Range Name
    By foxguy in forum Excel Programming / VBA / Macros
    Replies: 15
    Last Post: 10-13-2011, 11:39 AM
  5. Evaluate & Lookup?
    By BodyHaven in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 07-16-2008, 12:02 PM
  6. Evaluate Range of Cell
    By halem2 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-03-2006, 11:55 AM
  7. [SOLVED] HOW to Evaluate a range with IF ?
    By dancab in forum Excel General
    Replies: 3
    Last Post: 09-01-2005, 01:05 PM

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