+ Reply to Thread
Results 1 to 28 of 28

formula to find quantities

  1. #1
    Registered User
    Join Date
    11-22-2020
    Location
    India
    MS-Off Ver
    2016
    Posts
    42

    formula to find quantities

    a = 72,000
    b = 68,500
    c = 83,000
    d = 99,900

    need to find quantity of a, b, c & d to be bought for x amount

    get me an Excel formula, I will enter x amount

    a, b, c & d are constant, only x value changes, I need to find the qty of a,b,c,d
    please guide, if it cannot be solved by a formula, then suggest me a code.
    Attached Files Attached Files
    Last edited by itsjamaal; 05-28-2024 at 03:26 AM. Reason: Attachment

  2. #2
    Forum Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    O365 v 2504
    Posts
    13,638

    Re: formula to find quantities

    Welcome to the forum

    Please attach a sample workbook (not a picture or pasted copy). 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.

  3. #3
    Forum Expert
    Join Date
    07-20-2011
    Location
    Mysore, India.
    MS-Off Ver
    Excel 2019
    Posts
    8,710

    Re: formula to find quantities

    What are the conditions for purchase of cars. All cars are to be purchased or single type or lowest price cars etc.
    Pl note
    Array formula should be confirmed with Ctrl+Shift+Enter keys together.
    If answere is satisfactory press * to add reputation.

  4. #4
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2505 (Windows 11 Home 24H2 64-bit)
    Posts
    91,301

    Re: formula to find quantities



    Type 5 into G2.

    In B2 copied down:

    =$G$2

    Is this what you mean?

    AliGW on MS365 Beta Channel (Windows 11) 64 bit

    A
    B
    C
    D
    E
    F
    G
    1
    Car Quantity Unit Price Total Amount
    2
    a
    5
    72,000
    360,000.00
    5
    3
    b
    5
    68,500
    342,500.00
    4
    c
    5
    83,000
    415,000.00
    5
    d
    5
    99,900
    499,500.00
    6
    Grand Total
    20
    1,617,000.00
    Sheet: Sheet2
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help. It's a universal courtesy.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    NB:
    as a Moderator, I never accept friendship requests.
    Forum Rules (updated August 2023): please read them here.

  5. #5
    Registered User
    Join Date
    11-22-2020
    Location
    India
    MS-Off Ver
    2016
    Posts
    42

    Re: formula to find quantities

    Quote Originally Posted by kvsrinivasamurthy View Post
    What are the conditions for purchase of cars. All cars are to be purchased or single type or lowest price cars etc.
    All cars should be purchased.
    Actually, I have to send the quote to customers.

  6. #6
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2505 (Windows 11 Home 24H2 64-bit)
    Posts
    91,301

    Re: formula to find quantities

    And you reply to post #4?

    If that's not it, manually MOCK UP what you want in the workbook and attach it again.

  7. #7
    Registered User
    Join Date
    11-22-2020
    Location
    India
    MS-Off Ver
    2016
    Posts
    42

    Re: formula to find quantities

    Refer to the attached Excel sheet.
    The customer will inform his Budget, I need to quote the quantity of 4 Model cars to the exact budget.
    I am trying to find a formula or code to resolve this.

  8. #8
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2505 (Windows 11 Home 24H2 64-bit)
    Posts
    91,301

    Re: formula to find quantities

    I have - the worksheet does NOT show us what you want.

    Do as I have asked in post #6. We are NOT clairvoyant!!!

  9. #9
    Registered User
    Join Date
    11-22-2020
    Location
    India
    MS-Off Ver
    2016
    Posts
    42

    Re: formula to find quantities

    Sorry, I have attached the file again with required data
    Attached Files Attached Files

  10. #10
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2505 (Windows 11 Home 24H2 64-bit)
    Posts
    91,301

    Re: formula to find quantities

    OK - so it's still not clear. What is the starting point? You said a value of x - which is the x value?

  11. #11
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2406
    Posts
    44,662

    Re: formula to find quantities

    What are the rules?

    There are two options in your file, which give the same exact amount.

    Which is preferred?
    Why?
    If an exact match is not possible, should it be the nearest possible solution ABOVE the budget, or below the budget?
    Where do you tell Excel WHAT the budget actually is?
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU

  12. #12
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    30,977

    Re: formula to find quantities

    My interpretation is the budget is the amount in D6/D15 and what is required is a mix of cars to meet this figure. With such a "vague" specification,
    the mix of cars could be considerable.

    And as Glenn pointed out: is a nearest possible solution acceptable, and if so, within what boundaries (+/- 10%)?
    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED.

  13. #13
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    30,977

    Re: formula to find quantities

    Please Login or Register  to view this content.
    Attached Files Attached Files
    Last edited by JohnTopley; 05-28-2024 at 11:42 AM.

  14. #14
    Registered User
    Join Date
    11-22-2020
    Location
    India
    MS-Off Ver
    2016
    Posts
    42

    Re: formula to find quantities

    Run-time error '1004':

    Application-defined or object-defined error

  15. #15
    Registered User
    Join Date
    11-22-2020
    Location
    India
    MS-Off Ver
    2016
    Posts
    42

    Re: formula to find quantities

    Should be exact of budget amount

  16. #16
    Registered User
    Join Date
    11-22-2020
    Location
    India
    MS-Off Ver
    2016
    Posts
    42

    Re: formula to find quantities

    Every time the budget differs. But, I have to quote to match the exact budget amount.
    two options are given as example

  17. #17
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2505 (Windows 11 Home 24H2 64-bit)
    Posts
    91,301

    Re: formula to find quantities

    An exact match will not always be possible.

  18. #18
    Registered User
    Join Date
    11-22-2020
    Location
    India
    MS-Off Ver
    2016
    Posts
    42

    Re: formula to find quantities

    value of X is budget given by the customer, the total amount should exactly match the budget,
    and I have to quote the quantity on all the cars

  19. #19
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2505 (Windows 11 Home 24H2 64-bit)
    Posts
    91,301

    Re: formula to find quantities

    Mathematically, this will NOT always be possible.

  20. #20
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    30,977

    Re: formula to find quantities

    Run-time error '1004':

    Application-defined or object-defined error
    Not very helpful: code works fine for me, having done mutiple tests, including re-runs on the file I posted (re-aattached). There is nothing in the VBA that will not work in Excel 2010.

    So what is different in your data?

    Please post file giving error
    Attached Files Attached Files
    Last edited by JohnTopley; 05-29-2024 at 03:32 AM.

  21. #21
    Registered User
    Join Date
    11-22-2020
    Location
    India
    MS-Off Ver
    2016
    Posts
    42

    Re: formula to find quantities

    Mine is excel 2016

  22. #22
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    30,977

    Re: formula to find quantities

    ... Then update your profile with your current Excel version.

    And re-read request in post #20: you are not helping us to help you.

  23. #23
    Registered User
    Join Date
    11-22-2020
    Location
    India
    MS-Off Ver
    2016
    Posts
    42

    Lightbulb Re: formula to find quantities

    Quote Originally Posted by JohnTopley View Post
    ... Then update your profile with your current Excel version.

    And re-read request in post #20: you are not helping us to help you.
    I have updated my profile, thanks.

    Your solution helped me to solve the issue. Thanks a lot.

  24. #24
    Registered User
    Join Date
    11-22-2020
    Location
    India
    MS-Off Ver
    2016
    Posts
    42

    Re: formula to find quantities

    Thanks a lot.
    My question is answered, Mark it as solved.

  25. #25
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2505 (Windows 11 Home 24H2 64-bit)
    Posts
    91,301

    Re: formula to find quantities

    You need to do that.

    If that takes care of your original question, please choose Thread Tools from the menu link above and mark this thread as SOLVED. You can also access the SOLVED tag by editing the opening post and choosing SOLVED from the drop-down to the left of the title box.

    Also, if you have not already done so, remember that you can reward anyone who offered you help towards a solution for your issue by clicking the small star icon (* Add Reputation) located in the lower left corner of the post in which the help was given. By doing so you can add to the reputation(s) of each of those who offered help.

  26. #26
    Registered User
    Join Date
    11-22-2020
    Location
    India
    MS-Off Ver
    2016
    Posts
    42

    Re: formula to find quantities

    Thanks for educating.
    I have marked as solved, and added reputation already which he really deserves.

  27. #27
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    30,977

    Re: formula to find quantities

    For completenees, added code to handle no solution found:

    Please Login or Register  to view this content.
    Attached Files Attached Files

  28. #28
    Registered User
    Join Date
    11-22-2020
    Location
    India
    MS-Off Ver
    2016
    Posts
    42

    Re: formula to find quantities

    Thanks a lot

+ 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. Position Lot tracker - find quantities in excess and relieve
    By mikey3580 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 04-25-2023, 10:29 AM
  2. Find Text in Range of Cells and Sum All Quantities for Matched Cell
    By NardoBro in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 02-15-2017, 04:35 PM
  3. [SOLVED] Looking for help on a Loop to find and update stock sheet quantities
    By kuduck in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 12-15-2015, 05:21 PM
  4. [SOLVED] Formula to show quantities for amount entered
    By mutedf8 in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 10-02-2013, 12:34 AM
  5. Excel 2007 : Configure Quantities with Formula?
    By pawsjewl in forum Excel General
    Replies: 1
    Last Post: 02-03-2012, 04:31 PM
  6. Formula for Material Quantities
    By Boomhauer in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 09-14-2010, 05:06 AM
  7. formula for quantities
    By kayjohnson in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 07-07-2008, 11:24 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