Results 1 to 10 of 10

Improving on two formulas that create length and quantity

Threaded View

  1. #1
    Registered User
    Join Date
    10-25-2012
    Location
    Thailand
    MS-Off Ver
    Excel 2007, 2013
    Posts
    30

    Improving on two formulas that create length and quantity

    Hi all,

    I am looking to to improve and simplify two formulas in an old spreadhseet that I am making changes to. In a nutshell:

    I have an actual length value of something. (B8)
    If that length is longer than the maximum allowed length (B3), I need to add extra length for an overlap. I use the formula in cell B11 for this. I use formula in cell B10 to calculate the total quantity.

    My formulas work but are quite cumbersome. I am wondering if anyone has any more elegant solutions to my issue. I am not adverse to using VBA to achieve it, but I still do not know a way to do it elegantly in VBA.

    I also have many different columns and different variables for differing lengths over many sheets. So fixed formulas seem the easiest way for me to go to remember what I am doing. I have attached a basic working excel sheet with my current formulas.

    Formula for B11:
    =IF(B7="","",SUM(IF(B8>(7*(VLOOKUP(A$1 & " Max Length",$A$3:$B$6,2,FALSE) - VLOOKUP(A$1 & " Overlap Length",$A$3:$B$6,2,FALSE))),ROUNDUP(((B8/8)+VLOOKUP(A$1 & " Overlap Length",$A$3:$B$6,2,FALSE)),-2),IF(B8>(6*(VLOOKUP(A$1 & " Max Length",$A$3:$B$6,2,FALSE) - VLOOKUP(A$1 & " Overlap Length",$A$3:$B$6,2,FALSE))),ROUNDUP(((B8/7)+VLOOKUP(A$1 & " Overlap Length",$A$3:$B$6,2,FALSE)),-2),IF(B8>(5*(VLOOKUP(A$1 & " Max Length",$A$3:$B$6,2,FALSE) - VLOOKUP(A$1 & " Overlap Length",$A$3:$B$6,2,FALSE))),ROUNDUP(((B8/6)+VLOOKUP(A$1 & " Overlap Length",$A$3:$B$6,2,FALSE)),-2),IF(B8>(4*(VLOOKUP(A$1 & " Max Length",$A$3:$B$6,2,FALSE) - VLOOKUP(A$1 & " Overlap Length",$A$3:$B$6,2,FALSE))),ROUNDUP(((B8/5)+VLOOKUP(A$1 & " Overlap Length",$A$3:$B$6,2,FALSE)),-2),IF(B8>(3*(VLOOKUP(A$1 & " Max Length",$A$3:$B$6,2,FALSE) - VLOOKUP(A$1 & " Overlap Length",$A$3:$B$6,2,FALSE))),ROUNDUP(((B8/4)+VLOOKUP(A$1 & " Overlap Length",$A$3:$B$6,2,FALSE)),-2),IF(B8>(2*(VLOOKUP(A$1 & " Max Length",$A$3:$B$6,2,FALSE) - VLOOKUP(A$1 & " Overlap Length",$A$3:$B$6,2,FALSE))),ROUNDUP(((B8/3)+VLOOKUP(A$1 & " Overlap Length",$A$3:$B$6,2,FALSE)),-2),IF(B8>(1*VLOOKUP(A$1 & " Max Length",$A$3:$B$6,2,FALSE)),ROUNDUP(((B8/2)+VLOOKUP(A$1 & " Overlap Length",$A$3:$B$6,2,FALSE)),-2),ROUNDUP(B8,-2))))))))))
    Formula for B10:
    =IF(B8>(2*(VLOOKUP(A$1 & " Max Length",$A$3:$B$6,2,FALSE) - VLOOKUP(A$1 & " Overlap Length",$A$3:$B$6,2,FALSE))),ROUNDUP((((2* VLOOKUP(A$1 & " Overlap Length",$A$3:$B$6,2,FALSE))+B8)/ VLOOKUP(A$1 & " Max Length",$A$3:$B$6,2,FALSE)),0),IF(B8>(2*(VLOOKUP(A$1 & " Max Length",$A$3:$B$6,2,FALSE) - VLOOKUP(A$1 & " Overlap Length",$A$3:$B$6,2,FALSE))),ROUNDUP((((2* VLOOKUP(A$1 & " Overlap Length",$A$3:$B$6,2,FALSE))+B8)/ VLOOKUP(A$1 & " Max Length",$A$3:$B$6,2,FALSE)),0),IF(B8>(2*(VLOOKUP(A$1 & " Max Length",$A$3:$B$6,2,FALSE) - VLOOKUP(A$1 & " Overlap Length",$A$3:$B$6,2,FALSE))),ROUNDUP((((2* VLOOKUP(A$1 & " Overlap Length",$A$3:$B$6,2,FALSE))+B8)/ VLOOKUP(A$1 & " Max Length",$A$3:$B$6,2,FALSE)),0),IF(B8>(2*(VLOOKUP(A$1 & " Max Length",$A$3:$B$6,2,FALSE) - VLOOKUP(A$1 & " Overlap Length",$A$3:$B$6,2,FALSE))),ROUNDUP((((2* VLOOKUP(A$1 & " Overlap Length",$A$3:$B$6,2,FALSE))+B8)/ VLOOKUP(A$1 & " Max Length",$A$3:$B$6,2,FALSE)),0),IF(B8>(2*(VLOOKUP(A$1 & " Max Length",$A$3:$B$6,2,FALSE) - VLOOKUP(A$1 & " Overlap Length",$A$3:$B$6,2,FALSE))),ROUNDUP((((2* VLOOKUP(A$1 & " Overlap Length",$A$3:$B$6,2,FALSE))+B8)/ VLOOKUP(A$1 & " Max Length",$A$3:$B$6,2,FALSE)),0),IF(B8>(2*(VLOOKUP(A$1 & " Max Length",$A$3:$B$6,2,FALSE) - VLOOKUP(A$1 & " Overlap Length",$A$3:$B$6,2,FALSE))),ROUNDUP((((2* VLOOKUP(A$1 & " Overlap Length",$A$3:$B$6,2,FALSE))+B8)/ VLOOKUP(A$1 & " Max Length",$A$3:$B$6,2,FALSE)),0),IF(B8>(1* VLOOKUP(A$1 & " Max Length",$A$3:$B$6,2,FALSE)),ROUNDUP((((1* VLOOKUP(A$1 & " Overlap Length",$A$3:$B$6,2,FALSE))+B8)/ VLOOKUP(A$1 & " Max Length",$A$3:$B$6,2,FALSE)),0),1)))))))
    If anyone can assist, I would be grateful.
    Attached Files Attached Files

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] I am trying to create a Quantity box for a scanning spreadsheet i have created.
    By BlueCheese in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 05-14-2019, 06:41 AM
  2. Improving the method "how to create a function"
    By alexgoaga in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-12-2018, 08:22 AM
  3. Help improving a macro to create pdf
    By tfilipe in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 06-24-2018, 08:12 PM
  4. Replies: 24
    Last Post: 05-24-2017, 09:49 AM
  5. Replies: 1
    Last Post: 05-09-2017, 09:16 AM
  6. Replies: 1
    Last Post: 05-09-2017, 09:16 AM
  7. Corporate Mobilization Forecast - Questions on improving, formulas & functions Excel
    By Byambadorj in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-09-2017, 06:10 AM

Tags for this Thread

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