+ Reply to Thread
Results 1 to 4 of 4

How to make part of formula take precedence over another part?

  1. #1
    Registered User
    Join Date
    11-12-2020
    Location
    Sheffield, England
    MS-Off Ver
    2016
    Posts
    4

    How to make part of formula take precedence over another part?

    I have a search tool on excel which essentially searches for the best tool in a database based on sizes inputted in the search fields.
    Now I am just optimising this to pick the best tool and I have spotted a flaw with the formula and would like to change how this is calculated - I have tried everything in my knowledge to no avail so hopefully someone may be able to assist?

    Basically the formula (cell C7) looks for values in the database which are the closest match (either greater than or equal to) and returns the corresponding tool reference; this works fine but it isn't picking the most optimised tool for the job. What I would like the formula to do is pick the closest match for cell I40 (O/All length) from the values in sheet 'Container Tool', cells AE4:AE400 however, it seems that cell H43 (Bottom OD) takes precedence over this in the formula and then returns a tool that isn't as optimistic as it could be - so my question is how do I change the order in which this is calculated and make 'O/All length' more important than 'Bottom OD' in the formula when finding the best tool?

    Looking forward to your answers!

    Many thanks in advance!

    Jordan
    Last edited by jordonix; 11-22-2020 at 04:55 PM.

  2. #2
    Forum Guru Kaper's Avatar
    Join Date
    12-14-2013
    Location
    Warsaw, Poland
    MS-Off Ver
    most often: Office 365 in Windows environment
    Posts
    8,640

    Re: How to make part of formula take precedence over another part?

    Your current formula does not prefer match by any column. It just searches top-bottom for first row, where all conditions are met and returns the tool no from this row.

    So we have to somehow organize the results (assign weights to rows fulfilling all required conditions) and find the best fit. A proposition could be for instance:
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    Yes, I know it's long :-) but basically its just repeated twice almost the same formula.
    we create a reference table with weights (and empty strings if not all conditions are met):
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    and calculate minimum value in this table. Then we take INDEX(ToolNos,MATCH(ourMin, OurTable,0))

    I thought it could be in a tricky way (assuming in AE you have only values less than for instance 1000) made a bit shorter.
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Shows it's not - the same length. Probably also similar computing time. So may be better stay with the first one.

    As opposite to original, this formula do not accept presence of errors in Container Tool sheet. There was one caused by a space (not real empty cell) in a cell D294. I deleted it.

    See attached file if it works the way you looked for. BTW. In case of 2 or more valuse optimal from the point of view of AE column we will end up again with situation that topmost of the tools meening all conditions and having optimal value of AE column is selected.
    Attached Files Attached Files
    Best Regards,

    Kaper

  3. #3
    Registered User
    Join Date
    11-12-2020
    Location
    Sheffield, England
    MS-Off Ver
    2016
    Posts
    4

    Re: How to make part of formula take precedence over another part?

    Fantastic! This has solved my problem! Thank you so much for your help!!

  4. #4
    Forum Guru Kaper's Avatar
    Join Date
    12-14-2013
    Location
    Warsaw, Poland
    MS-Off Ver
    most often: Office 365 in Windows environment
    Posts
    8,640

    Re: How to make part of formula take precedence over another part?

    Hi,

    Glad to hear that, and thanks for marking thread as Solved.

    It would be lovely if you colud also "add me some reputation" by clicking a small star icon in lowerleft corner of my posts. (and confirming in pop-up/dialog window that "you agree").

    Best Regards,

    Kaper

+ 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] Formula to sum Credit part and debit part data in column
    By rizmomin in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 06-30-2020, 03:43 PM
  2. Formula to move part of a value to a new cell - part 2
    By forestavekids in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 04-28-2016, 12:34 PM
  3. Replies: 1
    Last Post: 01-03-2016, 11:48 PM
  4. Make part of a cell Bold using a formula??
    By Neil07979 in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 05-17-2014, 06:22 PM
  5. Replies: 3
    Last Post: 06-24-2009, 11:49 AM
  6. How do I make a part number formula?
    By Fastenal(FPAL) in forum Excel General
    Replies: 4
    Last Post: 04-23-2009, 03:15 PM
  7. [SOLVED] how do i make one part of my formula bold and the other normal?
    By niquey in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 03-27-2006, 10:25 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