+ Reply to Thread
Results 1 to 11 of 11

Populate cell on worksheet based values from another worksheet

  1. #1
    Registered User
    Join Date
    06-21-2010
    Location
    Rome, Italy
    MS-Off Ver
    Excel 2007
    Posts
    7

    Populate cell on worksheet based values from another worksheet

    Hello all,

    I'm new to the forum and when it comes to macros/vba within excel.

    Wondering if anyone could help with an issue I'm having to resolve:

    I have two worksheets, in one I have the following:

    Weight from
    Weight to
    Price
    0
    500
    100
    501
    1000
    165
    1001
    2000
    210
    2001
    3000
    265

    for over 3000, it's an additional 35 for every 1000.

    In the other worksheet I need to automatically populate the cell called "price"
    when I enter the weight in the cell "Weight" based on whats detailed in
    the 1st worksheet.

    I would apreciate any help you can give me.

    Regards,

    Joe
    Last edited by Mitzy_fto; 06-21-2010 at 03:28 PM.

  2. #2
    Forum Expert pike's Avatar
    Join Date
    12-11-2005
    Location
    Alstonville, Australia
    MS-Off Ver
    2016
    Posts
    5,330

    Re: Populate cell on worksheet based values from another worksheet

    Hi Mitzy_fto
    Welcome to the forum
    Depending on the sheet names and the columns... it will be along the lines of......

    =LOOKUP(Sheet2!A1,Sheet1!A:A,Sheet1!C:C)
    If the solution helped please donate to RSPCA

    Site worth visiting: Rabbitohs

  3. #3
    Registered User
    Join Date
    06-21-2010
    Location
    Rome, Italy
    MS-Off Ver
    Excel 2007
    Posts
    7

    Re: Populate cell on worksheet based values from another worksheet

    Hi thanks for the reply,

    I get an error when I try it...

    I've attached a sample of the workbook for you. When I enter the weight in the Invoice sheet, based on the from/to weight contained on the Detail_1 sheet, I need the relevant price copied to
    the price cell on the invoice sheet. But also, when we hit the 40000 threshold for every subsequent 10000 I need to take the last price and then add the 156.80 to it.

    Thanks again,

    Joe
    Attached Files Attached Files

  4. #4
    Forum Expert pike's Avatar
    Join Date
    12-11-2005
    Location
    Alstonville, Australia
    MS-Off Ver
    2016
    Posts
    5,330

    Re: Populate cell on worksheet based values from another worksheet

    Hi Mitzy_fto
    Had to add a zero for the ...
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    06-21-2010
    Location
    Rome, Italy
    MS-Off Ver
    Excel 2007
    Posts
    7

    Re: Populate cell on worksheet based values from another worksheet

    Hi Pike,

    Thanks for that, thats great. How would I go about doing the values above 40000?
    I need to had the value in cell G16, for every 10000 in weight above the 40000
    threshold.

    i.e. Weight 44000 result would be 893.30 + 156.80, 55000 would be 893.30 + (2 x 156.80)
    and so on.

    Thanks again for you help so far. I'm extremelly greatfull

    Joe

  6. #6
    Forum Expert pike's Avatar
    Join Date
    12-11-2005
    Location
    Alstonville, Australia
    MS-Off Ver
    2016
    Posts
    5,330

    Re: Populate cell on worksheet based values from another worksheet

    Hi Mitzy_fto

    something like
    =LOOKUP(H2,Detail_1!B3:B14,Detail_1!G3:G14)+IF(H2>40000,(ROUNDUP(H2/10000,0)-4)*156.8,0)

  7. #7
    Registered User
    Join Date
    06-21-2010
    Location
    Rome, Italy
    MS-Off Ver
    Excel 2007
    Posts
    7

    Re: Populate cell on worksheet based values from another worksheet

    Quote Originally Posted by pike View Post
    Hi Mitzy_fto

    something like
    =LOOKUP(H2,Detail_1!B3:B14,Detail_1!G3:G14)+IF(H2>40000,(ROUNDUP(H2/10000,0)-4)*156.8,0)
    Hi, Thanks for the reply when I add the if statement I get;

    The entered formula contains an error.

    Thanks again for your help with this.

    Joe

  8. #8
    Forum Expert pike's Avatar
    Join Date
    12-11-2005
    Location
    Alstonville, Australia
    MS-Off Ver
    2016
    Posts
    5,330

    Re: Populate cell on worksheet based values from another worksheet

    Strange it works for me

    =LOOKUP(H2,Detail_1!B3:B14,Detail_1!G3:G14)+IF(H2>40000,(ROUNDUP(H2/10000,0)-4)*156.8,0)
    Attached Files Attached Files

  9. #9
    Forum Expert snb's Avatar
    Join Date
    05-09-2010
    Location
    VBA
    MS-Off Ver
    Redhat
    Posts
    5,649

    Re: Populate cell on worksheet based values from another worksheet

    Why using a table when math can give the result ?

    =110 +integer(H2/1000)*55

  10. #10
    Registered User
    Join Date
    06-21-2010
    Location
    Rome, Italy
    MS-Off Ver
    Excel 2007
    Posts
    7

    Re: Populate cell on worksheet based values from another worksheet

    Quote Originally Posted by snb View Post
    Why using a table when math can give the result ?

    =110 +integer(H2/1000)*55
    With that I just get #NAME?

    They have changed the criteria on me...

    It's now > 50000 and 53.42 for every 1000 now

    is it just a case of changing the formula to:

    +IF(H2>50000,(ROUNDUP(H2/1000,0)-4)*53.42,0)

    Thanks,

    Joe

  11. #11
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Populate cell on worksheet based values from another worksheet

    Most of those columns are unnecessary.

    Please Login or Register  to view this content.

    The formula in E3 is =VLOOKUP(D3, $A$3:$B$14, 2) + MAX(0, CEILING((D3 - 40000)/10000, 1) * $B$16)
    Entia non sunt multiplicanda sine necessitate

+ 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