+ Reply to Thread
Results 1 to 14 of 14

Variable materials and prices formula

  1. #1
    Forum Contributor
    Join Date
    08-25-2012
    Location
    South Africa
    MS-Off Ver
    Excel 2010
    Posts
    125

    Variable materials and prices formula

    Hi Everyone

    I have attached a sample workbook to try and explain my challenge.
    In cell F:2 I need a formula that uses the values in cell A:2 and Cell C:2.
    These values change according to what the user inserts. The formula needs to cover a wide spectrum of variables.
    eg: IF cell A:2(PRODUCT) = "WOOD"
    AND cell C:2(PRODUCT) = 3
    THEN = cell B:2(PRICES) ie: R2.00


    OR

    IF cell A:2(PRODUCT) = "WOOD"
    AND cell C:2(PRODUCT) = 6
    THEN = cell C:2(PRICES) ie R4.00

    Etc Etc

    Once I have a formula worked out I need to copy it down in column F.

    I have inserted a formula in F:2 , but this only has one variable .
    So basically the formula could be something like this I think.


    =IF(AND(A:2="WOOD",C:2=3),PRICES!B:2,IF(AND((A:2="WOOD",C:2=6),PRICES!C:2etc etc etc

    Maybe I totally of track here and there is an easier way.

    Pleases help

    Onesock
    Attached Files Attached Files

  2. #2
    Valued Forum Contributor
    Join Date
    07-27-2012
    Location
    Dublin, Ireland
    MS-Off Ver
    Excel 2010
    Posts
    826

    Re: Variable materials and prices formula

    Hello Onesock,

    Please Login or Register  to view this content.
    in F2 should do the trick for you.

    (Please note I copied your price info to the sheet I was working on for convenience - you can just change the cell references to the PRICES sheet if you're happy with it.)
    Attached Files Attached Files
    Brendan.


    __________________________________________________________________________________________________
    Things to consider:

    1) You can thank any poster by clicking the * at the left of a helpful post.
    2) You can help to keep the forum tidy by marking your thread as "Solved", if it has been answered to your satisfaction.
    3) Help us to help you, by uploading a sample workbook, showing the type of data you're dealing with, and clearly indicating what the results should be.

  3. #3
    Banned User!
    Join Date
    10-14-2006
    Posts
    1,211

    Re: Variable materials and prices formula

    Quote Originally Posted by BB1972 View Post
    Hello Onesock,

    Please Login or Register  to view this content.
    in F2 should do the trick for you.

    (Please note I copied your price info to the sheet I was working on for convenience - you can just change the cell references to the PRICES sheet if you're happy with it.)
    compact version

    =INDEX(L1:Q6,MATCH(A2,K1:K6,)+1,MATCH(C2,INDEX(L1:Q6,MATCH(A2,K1:K6,),),))

  4. #4
    Valued Forum Contributor
    Join Date
    07-27-2012
    Location
    Dublin, Ireland
    MS-Off Ver
    Excel 2010
    Posts
    826

    Re: Variable materials and prices formula

    Very nice, TM!

  5. #5
    Forum Contributor
    Join Date
    08-25-2012
    Location
    South Africa
    MS-Off Ver
    Excel 2010
    Posts
    125

    Re: Variable materials and prices formula

    Hi BB and TM

    First off thank you for your generosity in sharing info .The formulas really work a treat. You people are really a great help.
    OK - so now a bit more !! . Can the formula be written so the #N/A is NOT shown when a cell is not being used,but instead the cell is left blank. Or though , if a specific thickness doesnt correspond with the material in the table the cell then could read #N/A or something else to show that ,that material doesnt have that specific thickness .
    For example if I inserted 8 into the "WOOD" thickness it would return #N/A or some form of warning.

    See revised sheet for example
    Attached Files Attached Files

  6. #6
    Forum Contributor
    Join Date
    08-25-2012
    Location
    South Africa
    MS-Off Ver
    Excel 2010
    Posts
    125

    Re: Variable materials and prices formula

    Bump no response

  7. #7
    Forum Contributor
    Join Date
    08-25-2012
    Location
    South Africa
    MS-Off Ver
    Excel 2010
    Posts
    125

    Re: Variable materials and prices formula

    Bump no response

  8. #8
    Forum Expert Ace_XL's Avatar
    Join Date
    06-04-2012
    Location
    UAE
    MS-Off Ver
    2016
    Posts
    6,074

    Re: Variable materials and prices formula

    In F2 for 2003 and earlier versions

    Please Login or Register  to view this content.
    For later versions
    Please Login or Register  to view this content.
    copied down

    Similarly, in G2
    Please Login or Register  to view this content.
    or
    Please Login or Register  to view this content.
    copied down
    Life's a spreadsheet, Excel!
    Say thanks, Click *

  9. #9
    Forum Contributor
    Join Date
    08-25-2012
    Location
    South Africa
    MS-Off Ver
    Excel 2010
    Posts
    125

    Re: Variable materials and prices formula

    Hi Ace_XL

    Thats fantastic !! Only one more issue.
    If I insert a thickness that does not correspond with a thickness of that particular material in the table, is there a way that some form of error return comes up in cells F: and G:.

    Thanks

    Onesock

  10. #10
    Valued Forum Contributor
    Join Date
    07-27-2012
    Location
    Dublin, Ireland
    MS-Off Ver
    Excel 2010
    Posts
    826

    Re: Variable materials and prices formula

    Cheers, Ace - I was struggling to wrap an IF/ISERROR around the original formula (and keep it working.)

  11. #11
    Valued Forum Contributor
    Join Date
    07-27-2012
    Location
    Dublin, Ireland
    MS-Off Ver
    Excel 2010
    Posts
    826

    Re: Variable materials and prices formula

    Quote Originally Posted by BB1972 View Post
    Cheers, Ace - I was struggling to wrap an IF/ISERROR around the original formula (and keep it working.)
    Onesock,

    Where Ace has "" in his formulas above, you could insert e.g. CHECK SIZE between the "", so the formula would output CHECK SIZE, instead of the empty string (which is what's between the first " and the second ") being output at the moment.

  12. #12
    Forum Contributor
    Join Date
    08-25-2012
    Location
    South Africa
    MS-Off Ver
    Excel 2010
    Posts
    125

    Re: Variable materials and prices formula

    Hi BB

    Again - good call , or though it leaves "CHECK SIZE" in all the F column cells. This is because I have copied it down a few rows.
    In my actual spreadsheet template I have 50 or so rows that need to be filled in. If the cells in column F say "CHECK SIZE" because no other info is given , it will be untidy.
    I hope you would be able to get to the bottom of this and figure out a way to only show "CHECK SIZE" if a thickness is NOT corresponding to the material thickness in the table.
    I have attached the spreadsheet again for you to see.

    Thanks again

    Onesock
    Attached Files Attached Files

  13. #13
    Forum Contributor
    Join Date
    08-25-2012
    Location
    South Africa
    MS-Off Ver
    Excel 2010
    Posts
    125

    Re: Variable materials and prices formula

    Hi Again

    Sorry Ace_XL that was also meant for you.

    Onesock

  14. #14
    Valued Forum Contributor
    Join Date
    07-27-2012
    Location
    Dublin, Ireland
    MS-Off Ver
    Excel 2010
    Posts
    826

    Re: Variable materials and prices formula

    Done, with a little

    Please Login or Register  to view this content.
    in front of the original formula.
    Attached Files Attached Files

+ 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