+ Reply to Thread
Results 1 to 10 of 10

Need help with a closest match formula that avoids unwanted cells in an array

  1. #1
    Registered User
    Join Date
    08-07-2022
    Location
    Louisiana, USA
    MS-Off Ver
    365
    Posts
    8

    Need help with a closest match formula that avoids unwanted cells in an array

    MOC Spreadsheet.xlsx

    Please help with adjusting formula. Instructions in Excel File. Thank you!

  2. #2
    Forum Guru HansDouwe's Avatar
    Join Date
    06-21-2022
    Location
    Nederland
    MS-Off Ver
    365 V2403 (Build 17330.20000)
    Posts
    6,419

    Re: Need help with a closest match formula that avoids unwanted cells in an array

    Welcome to this forum.

    If you want to recognize which values are italicized, you need a VBA-solution, because Excel-formulas couldn't recognize which numbers are italicized.
    Do you want a VBA-solution or is it possible to indicate in a other way which numbers should be excluded?
    Last edited by HansDouwe; 08-07-2022 at 03:33 PM.

  3. #3
    Registered User
    Join Date
    08-07-2022
    Location
    Louisiana, USA
    MS-Off Ver
    365
    Posts
    8

    Re: Need help with a closest match formula that avoids unwanted cells in an array

    Hi! Thanks for replying. The only indication to avoid are the values being italicized. I am leaving an internship soon and my other employees have no VBA knowledge so I was trying to accomplish this without it. They will have to add data into a sheet of similar format and the formulas will most likely have to be edited because of this. I don't want the program to stop operating as soon as they do this because I will not be around to fix it.

    I have also tried naming the data set excluding the empty and italicized cells and adding that to the formula instead but it gives back a value error. I am not sure if I am trying to do something that really isn't possible without VBA or if there is a better way to do this.

  4. #4
    Forum Guru HansDouwe's Avatar
    Join Date
    06-21-2022
    Location
    Nederland
    MS-Off Ver
    365 V2403 (Build 17330.20000)
    Posts
    6,419

    Re: Need help with a closest match formula that avoids unwanted cells in an array

    If you can only indicate with itlicized numbers which numbers should be excluded, then VBA is the only option, because ordinary Excel formulas cannot recognize the format of a cell.
    If you want that, I'm sure a VBA specialist on this forum can handle this. (I'm not good enough either in VBA)

  5. #5
    Forum Guru HansDouwe's Avatar
    Join Date
    06-21-2022
    Location
    Nederland
    MS-Off Ver
    365 V2403 (Build 17330.20000)
    Posts
    6,419

    Re: Need help with a closest match formula that avoids unwanted cells in an array

    Or would it be an option to indicate with a flag next to each digit whether it should be excluded or not.
    The flag can then make the number itilicized with conditional formatting.
    The Excel-formulas can use the flag to exclude these numbers from the calculation.

  6. #6
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,607

    Re: Need help with a closest match formula that avoids unwanted cells in an array

    There's nothing in the post or workbook that describes why those particular numbers are italicized. So, what rule are you using?
    4.5 & 5.5 are next to empty cells - italics
    8.5 next to empty cell - no italics
    3.2 not next to empty cell - italics
    Last edited by protonLeah; 08-07-2022 at 04:48 PM.
    Ben Van Johnson

  7. #7
    Registered User
    Join Date
    08-07-2022
    Location
    Louisiana, USA
    MS-Off Ver
    365
    Posts
    8

    Re: Need help with a closest match formula that avoids unwanted cells in an array

    This is just a small worksheet example I made to mimic the workbook I am unable to share. The numbers, blanks, and italics are all random in the MOC Spreadsheet. My actual workbook contains italicized values that are unverified values and these cannot be used in our calculations, but they need to stay in the cell and location they are in.

    Is there a way to make a formula exclude values attached to conditionally formatted cells?
    Last edited by helpmeexcelexperts; 08-07-2022 at 05:26 PM.

  8. #8
    Forum Guru HansDouwe's Avatar
    Join Date
    06-21-2022
    Location
    Nederland
    MS-Off Ver
    365 V2403 (Build 17330.20000)
    Posts
    6,419

    Re: Need help with a closest match formula that avoids unwanted cells in an array

    I can only solve it without VBA if you want to indicate in a different way which numbers have been verified.
    For example with this formula for the closest match in this sheet:
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    You should mark which numbers are verified (included) or not verified (excluded).

    This is possible, but there are many other possibilities. Maybe something like that could be an alternative solution?
    If you can only see which numbers are verified by the font then VBA is involved.
    Attached Files Attached Files
    Last edited by HansDouwe; 08-07-2022 at 07:06 PM.

  9. #9
    Registered User
    Join Date
    08-07-2022
    Location
    Louisiana, USA
    MS-Off Ver
    365
    Posts
    8

    Re: Need help with a closest match formula that avoids unwanted cells in an array

    Thanks! I will try to see if I can make something similar work! I really appreciate your time and help!

  10. #10
    Forum Guru HansDouwe's Avatar
    Join Date
    06-21-2022
    Location
    Nederland
    MS-Off Ver
    365 V2403 (Build 17330.20000)
    Posts
    6,419

    Re: Need help with a closest match formula that avoids unwanted cells in an array

    Glad to hear you appreciate this help. I liked doing that.

    It would be very nice if you were to just click the Add Reputation button at the foot of any of the posts of members who helped you reach a solution.

    If you have more questions or comments, please get back to us.

+ 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. Replies: 6
    Last Post: 06-13-2022, 09:24 AM
  2. Replies: 15
    Last Post: 10-29-2019, 06:46 AM
  3. [SOLVED] Formula to compare two cells to another cell and put closest match in cell
    By Metrazal in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 10-11-2019, 09:33 AM
  4. Finding Match or Closest match based on Multi Cells
    By Urlryn in forum Excel General
    Replies: 2
    Last Post: 08-30-2019, 07:07 AM
  5. [SOLVED] INDEX/ MULTIPLE MATCH LOOKUP... Grab closest low value from only one array
    By bwrobo in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 06-15-2019, 01:25 AM
  6. Help: Hlookup against multiple array display closest match
    By LightingPop in forum Excel Formulas & Functions
    Replies: 21
    Last Post: 01-08-2013, 12:29 AM
  7. Match Closest Results from Data Array
    By TheRobsterUK in forum Excel General
    Replies: 2
    Last Post: 09-29-2005, 08:48 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