+ Reply to Thread
Results 1 to 11 of 11

determine correct cell and color based on four parameters.

  1. #1
    Registered User
    Join Date
    06-04-2018
    Location
    illinois
    MS-Off Ver
    Microsoft 365
    Posts
    21

    determine correct cell and color based on four parameters.

    I need a macro or series of macros to determine the correct cell and then color to return a number for a product. In the attached file the correct answer would be D5. The parameters in M5-N7 determine what part of the table to look at then I need to find the closest number to N8 in the chart without N8 being larger than it.

    So, it should be looking at D5:D6 in the table then D5 would be the correct answer. But i am unsure how to do this in a macro or formula for the entire chart.


    Thanks in advance for any help.
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    08-17-2007
    Location
    Poland
    Posts
    2,300

    Re: determine correct cell and color based on four parameters.

    Let's assume that the user has selected:
    Pickup Ø = 50
    Suction Line = 5
    Elbows = 2
    Trim Speed = 900

    What value should be returned from the range E5:E6 when Trim Speed is greater than the allowed values (900>850)? Or should an error be returned?

    Artik

  3. #3
    Registered User
    Join Date
    06-04-2018
    Location
    illinois
    MS-Off Ver
    Microsoft 365
    Posts
    21

    Re: determine correct cell and color based on four parameters.

    Thanks for your reply.

    In that case, I would want to either return N/A or an error.

  4. #4
    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
    28,691

    Re: determine correct cell and color based on four parameters.

    Do want the cell address i.e D% or the value in D5? Plus cell colour?
    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED.

  5. #5
    Registered User
    Join Date
    06-04-2018
    Location
    illinois
    MS-Off Ver
    Microsoft 365
    Posts
    21

    Re: determine correct cell and color based on four parameters.

    I think just the cell color will work. it shows two different models so i can use the color to determine which one.

  6. #6
    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
    28,691

    Re: determine correct cell and color based on four parameters.

    Please Login or Register  to view this content.
    in N10

    =speed($N$5:$N$8)
    Attached Files Attached Files
    Last edited by JohnTopley; 03-15-2024 at 11:59 AM.

  7. #7
    Registered User
    Join Date
    06-04-2018
    Location
    illinois
    MS-Off Ver
    Microsoft 365
    Posts
    21

    Re: determine correct cell and color based on four parameters.

    Thanks for all your help. I think i just have one more thing. How would i modify this function to be able to do this operation on two different sheets. I tried to just copy the function to the next sheet, but it still seems to be looking at sheet one. I have attached a sample for reference.
    Attached Files Attached Files

  8. #8
    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
    28,691

    Re: determine correct cell and color based on four parameters.

    The function used named ranges whose scope is the workbook { and reference the 150µ sheet) , so it will not work with multiple sheets. Either repeat the named ranges with scope of a worksheet or I'll have change the code.

    How many sheets are there?

  9. #9
    Registered User
    Join Date
    06-04-2018
    Location
    illinois
    MS-Off Ver
    Microsoft 365
    Posts
    21

    Re: determine correct cell and color based on four parameters.

    It is just the two sheets didn't think about it originally needing the second sheet.

  10. #10
    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
    28,691

    Re: determine correct cell and color based on four parameters.

    Try

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

  11. #11
    Registered User
    Join Date
    06-04-2018
    Location
    illinois
    MS-Off Ver
    Microsoft 365
    Posts
    21

    Re: determine correct cell and color based on four parameters.

    that works thank you again for all the help.

+ 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] Determine tiered rates based on parameters
    By Carl1895 in forum Excel General
    Replies: 9
    Last Post: 02-04-2024, 10:36 PM
  2. [SOLVED] Correct syntax for function to find average based on background color of cells in range
    By moosetales in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 05-21-2014, 12:24 AM
  3. [SOLVED] How to COUNT cell based on either COLOR or correct result?
    By Kagesen in forum Excel General
    Replies: 3
    Last Post: 05-12-2014, 12:40 AM
  4. Can an IF statement determine the background color of a cell?
    By MDOC in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 06-25-2013, 04:28 PM
  5. [SOLVED] Macro: Use cell fill color to determine if to copy & paste to another cell on the same row
    By tsamuels in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 05-19-2013, 09:50 AM
  6. Can a Function determine the color of a cell or the text in a cell?
    By RightRides in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 03-07-2008, 02:15 PM
  7. How can I determine cell color?
    By Naum in forum Excel General
    Replies: 3
    Last Post: 05-14-2006, 03:35 PM

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