+ Reply to Thread
Results 1 to 11 of 11

need a value to react based on a range minimums

  1. #1
    Registered User
    Join Date
    01-16-2015
    Location
    Georgia
    MS-Off Ver
    10
    Posts
    23

    need a value to react based on a range minimums

    Hey there sorry so long and- Perhaps you can help me as my hair is getting thinner and thinner due to the consistency of pulling it out
    The work book that I have attached - In the Unit Pricing tab cell J10 - square footages are calculated to produce a dollar amount into cells L15 & M15 ( these amounts are also tied into specific states (cell C3) which also have a dollar amount attached to them and are part of the equation) What I would like for cells L15 and M15 to do is if the square footage in J10 is lees than 11,501 then the minimum dollar amount in L15 is $50.00 - If the square footage in J10 is between 11,501 - 25,500 then the minimum amount in L15 will formulate at $60.00 - If the square footage amount is 25,501 - 35,500 then the minimum amount in L15 is $70.00 and If the square footage amount in J10 = 35,500 -43,559 then the amount in L15 is $80.00 and finally if J10 is 43,560 (1 acre) the sheet will function the way that it is set up now
    Basically if the square footages drop below certain numbers then a minimum amount is activated based on the square footages but if the square footages are 35,501 and greater then the sheet will function the way that it is

    IE - enter 3000 into J10 (set c3 to GA or any state (which changes the associated amount based on state) -enter the number 2 into F15 to activate the calculation) it should come up as $6.00 in L15 and $12.00 in M15
    What I would like for it to do is (because j10 square footage is in the range of 1 - 11,500 ) that L15 is $50.00 and M15 is $100.00 )
    Now in J10 enter 12,000 (set c3 to GA or any state (which changes the associated amount based on state) -enter the number 2 into F15 to activate the calculation) it should come up as $21.00 in L15 and $42.00 in M15
    What I would like for it to do is (because j10 square footage is in the range of 11,501 - 25,500 ) that L15 is $60.00 and M15 is $120.00 )
    Now in J10 enter 26,000 (set c3 to GA or any state (which changes the associated amount based on state) -enter the number 2 into F15 to activate the calculation) it should come up as $45.00 in L15 and $90.00 in M15
    What I would like for it to do is (because j10 square footage is in the range of 25,501 - 35,500 ) that L15 is $70.00 and M15 is $140.00 )
    Now in J10 enter 36,000 (set c3 to GA or any state (which changes the associated amount based on state) -enter the number 2 into F15 to activate the calculation) it should come up as $62.00 in L15 and $124.00 in M15
    What I would like for it to do is (because j10 square footage is in the range of 35,501 - 43,559 ) that L15 is $80.00 and M15 is $160.00 )
    and Finally enter 43,560 into J10 it should read L15 $75.00 and M15 $150.00 - (Because J10 is 43,560 - infinity then the sheet should function as it is now)
    Sorry for the long story here - and I am sure I am overlooking a very simple solution but for the life of me I can not put my finger in it
    Thank you in advance for taking the time and for using your super powers to help me through this
    mdhancockga
    Attached Files Attached Files

  2. #2
    Forum Expert daffodil11's Avatar
    Join Date
    07-11-2013
    Location
    Phoenixville, PA
    MS-Off Ver
    MS Office 2016
    Posts
    4,465

    Re: need a value to react based on a range minimums

    I ran with this; the workbooks appears to already have code in it. I just added more.

    Whether J10 or F15 changes, the formula updates.
    Please Login or Register  to view this content.
    Attached Files Attached Files
    Make Mom proud: Add to my reputation if I helped out!

    Make the Moderators happy: Mark the Thread as Solved if your question was answered!

  3. #3
    Registered User
    Join Date
    01-16-2015
    Location
    Georgia
    MS-Off Ver
    10
    Posts
    23

    Re: need a value to react based on a range minimums

    Daffodil -
    May I start out by saying you are a hero among men and ty ty ty - I am forever in your debt -
    There is one more thing that I will ask - as I took what you had written and tried to do it myself - but started getting run time errors and got extremely scared

    Using everything that you have already done
    In Cell J10 if I enter 3000 (SF) and then in F15 I enter say a 5 - I need F15 to mulitply times L15 (in this case is $50.00) to equal M15 $250.00 - If I enter a 6 into F15 then M15 would equal 300 etc
    So basically when entering a number into F15 it multiplies X L15 to give M15 the Subtotal
    I hope that I did not confuse you and again I am so grateful to you and this community for helping me with this Frankenstein - tytytytyty
    Respectfully
    mdhancockga

  4. #4
    Registered User
    Join Date
    01-16-2015
    Location
    Georgia
    MS-Off Ver
    10
    Posts
    23

    Re: need a value to react based on a range minimums

    It only happens when I enable content just FYi - which constantly pops up when a team member opens the file "enable content"

  5. #5
    Forum Expert daffodil11's Avatar
    Join Date
    07-11-2013
    Location
    Phoenixville, PA
    MS-Off Ver
    MS Office 2016
    Posts
    4,465

    Re: need a value to react based on a range minimums

    All VBA programming requires you to enable it.

    The reason this is there is that even the very simple VBA can be written to be quite malicious. I always Disable, read the code, and then enable if I trust it.

  6. #6
    Forum Expert daffodil11's Avatar
    Join Date
    07-11-2013
    Location
    Phoenixville, PA
    MS-Off Ver
    MS Office 2016
    Posts
    4,465

    Re: need a value to react based on a range minimums

    I think I get it. You only want the formula to calculate to the minimum entry, IF F * L < Minimum for that square footage, then show minimum, but otherwise calculate normally?

  7. #7
    Registered User
    Join Date
    01-16-2015
    Location
    Georgia
    MS-Off Ver
    10
    Posts
    23

    Re: need a value to react based on a range minimums

    Daffodil
    Thank you for responding so quickly
    Yes - based on the minimums that you had written - for example the 1 - 11,500 (SF) @ $50.00 - My process is this - In J10 I enter say 3000 (sf) (falling tinto the 1-11,500 range) the formula would do everything that you have done - but in M15 it is the result of F15 * L15 - so in this case it would read as such:
    visits/apps SF Difficulty Price Per Visit Subtotal
    A. Mow turf, trim, and remove debris from sidewalk & curbs 3 3000 E/M/H $50.00 $150.00
    (the number under visits/apps will change based on what someone enters so it could be 3 or it could be 33 but that number should multiply by L15 (ranges that you had put in) so if it were 5 in the visits /apps the it woud be 5 * $50.00 and so on. I tried to copy and paste the line that you had written in else for M15 thinking that it would do the trick for each range line that you had written and on the back end it did - but run time error kept popping up and I knew then I must leave such a thing to the master (mean in I had copied Range("M15").Formula = "=SUM(L15*F15)" into the sequence for each line and replaced the Range("M15") = 100 for each line thinking that would solve - and It did but every time I entered a new number into any cell it gave me the run time error - I hope I haven't confused you and sorry for all the "crazy"

    once we move through the minimums and reach 43,559 then the formula that I had written would kick in -
    I am so grateful for you taking the time and I am still learning and you have been so awesome to work with me on this and I am forever in your debt

  8. #8
    Registered User
    Join Date
    01-16-2015
    Location
    Georgia
    MS-Off Ver
    10
    Posts
    23

    Re: need a value to react based on a range minimums

    Daffodil,
    Basically any number entered into F15 visits/Apps would multiply by the minimums that you had written giving the subtotal
    so if the number 3 was entered into F15 then it would read like this (F15) 3 * (L15) $50.00 (based on the minimums that you have already written) would = (M15) $150.00 or If I entered (F15) 6 * (L15) $50.00 would = (M15) $300.00 - this based on the ranges (1-11,500 = $50.00;11,501-25500 = $60.00 and so on - the amazing scripts that you had written before)

  9. #9
    Forum Expert daffodil11's Avatar
    Join Date
    07-11-2013
    Location
    Phoenixville, PA
    MS-Off Ver
    MS Office 2016
    Posts
    4,465

    Re: need a value to react based on a range minimums

    I'll give it another shot!

    I think I found the logic error. In your post when you described the Subtotals, I didn't think you were using a formula but wanted 'flat' minimums for subtotal.
    I removed all of the M15 lines from the code, and then just changed M15 in the spreadsheet back to F*L.

    Please Login or Register  to view this content.
    Last edited by daffodil11; 03-20-2015 at 10:32 AM.

  10. #10
    Registered User
    Join Date
    01-16-2015
    Location
    Georgia
    MS-Off Ver
    10
    Posts
    23

    Re: need a value to react based on a range minimums

    Daffodil
    If I can say - you light up my life....you are a Hero - It is done and I am forever in your debt - I am so grateful for you taking the time and making it so I can sleep at night tytyty
    Everything works and is perfect and....well just Thank you for being you -
    If I can ever do anything for you please let me know
    Respectfully
    mdhancockga

  11. #11
    Forum Expert daffodil11's Avatar
    Join Date
    07-11-2013
    Location
    Phoenixville, PA
    MS-Off Ver
    MS Office 2016
    Posts
    4,465

    Re: need a value to react based on a range minimums

    Hurray for happy endings!

+ 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. [SOLVED] Create a cell to react based on an "Inbetween value"
    By Julian86 in forum Excel General
    Replies: 2
    Last Post: 11-20-2013, 06:37 AM
  2. Replies: 1
    Last Post: 04-09-2013, 11:06 AM
  3. Find minimums
    By VBisgreat in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-24-2011, 10:08 AM
  4. How to make a range of cells react to changes in one cell
    By eleonore in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 05-21-2009, 07:14 PM
  5. Make autofilter react based upon selection in drop box...
    By jwhitwell in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 03-27-2009, 04:24 AM

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