+ Reply to Thread
Results 1 to 2 of 2

Prevent certain input from appearing in a range

  1. #1
    Registered User
    Join Date
    06-24-2022
    Location
    Singapore, Singapore
    MS-Off Ver
    2013
    Posts
    24

    Prevent certain input from appearing in a range

    Hi everyone,

    Understand my problem can be complex. Allow me to explain in detail.

    If you refer to my excel file, there were a number of different types of (MI) Measuring Instrument types (TPG, PG, CMM SRT etc)

    Previously, I wanted to achieve items with PG,TPG,TRG,RG or GB MI type will repeat themselves under the lower section: MEASURING INSTRUMENT USED at cell B110

    In addition, items with other types of MI will only repeat once e.g CMM, SRT, TM etc

    My current excel formula has achieved the following:
    1) Items will either TPG, PG, TRG, RG, GB will appear depending on the number of times it appears in the upper section
    2) Items with other types of MI will only repeat once
    3) Items with VI and NOTE type of MI will not appear at all


    However, I realized I needed to modify my existing formula by ensuring the following:
    a) item with "ID" indicated under the L/N will not appear, regardless of MI type. This condition is similar to No. 3 (Please refer to the cell in yellow in the attached workbook), although its MI type is PG. Based on the current formula, it will appear under section "MEASURING INSTRUMENT USED"

    b) Similar items which appear more than once will only appear once, regardless of MI type. This condition is similar to No. 2 (Please refer to cell in blue in the attached workbook), although its MI type is TPG. Based on the current formula, it will appear 4 times under section "MEASURING INSTRUMENT USED", similarly to the number of times I have added in the upper section.

    Can I kindly request any assistance to modify my existing formulas in the attached workbook?

    Much appreciated.

    Jude
    Attached Files Attached Files
    Last edited by Jude_Long; 09-26-2022 at 06:47 AM.

  2. #2
    Registered User
    Join Date
    06-24-2022
    Location
    Singapore, Singapore
    MS-Off Ver
    2013
    Posts
    24

    Re: Prevent certain input from appearing in a range

    Maybe just to add on for clarify sake, my current array formula in cell F111:F145 is:

    =IFERROR(IF(ROWS($1:1)<=COUNTIF($F$8:$F$108,"PG"),"PG",IF(ROWS($1:1)<=COUNTIF($F$8:$F$108,"PG")+COUNTIF($F$8:$F$108,"TPG"),"TPG",IF(ROWS($1:1)<=COUNTIF($F$8:$F$108,"TPG")+COUNTIF($F$8:$F$108,"TRG"),"TRG",IF(ROWS($1:1)<=COUNTIF($F$8:$F$108,"TPG")+COUNTIF($F$8:$F$108,"TRG")+COUNTIF($F$8:$F$108,"RG"),"RG",IF(ROWS($1:1)<=COUNTIF($F$8:$F$108,"PG")+COUNTIF($F$8:$F$108,"TPG")+COUNTIF($F$8:$F$108,"TRG")+COUNTIF($F$8:$F$108,"RG")+COUNTIF($F$8:$F$108,"GB"),"GB",INDEX($F$8:$F$108,MATCH(0,COUNTIF($F$110:F110,IF($F$8:$F$108="","",IF($F$8:$F$108="VI","",IF($F$8:$F$108="NOTE","",IF($F$8:$F$108="-","",$F$8:$F$108))))),0))))))),"")

    With that, I am able to achieve the following:

    1) Items will either TPG, PG, TRG, RG, GB as their MI type, will appear "n" times, depending on the number of times, "n", it appears in the upper section
    2) Items with other types of MI will only repeat once
    3) Items with VI and NOTE type of MI will not appear at all

    I am hoping to modify my formula such that i am also able to achieve:

    a) item with "ID" indicated under the L/N cell A8:A108, will not appear, regardless of MI type. This condition is similar to the above 3) scenario. (Please refer to the cell in yellow in the attached workbook), although its MI type is PG.
    Based on the current formula limitation, it will appear under section "MEASURING INSTRUMENT USED"

    b) Similar items which appear more than once under cell B, D and E (E.g 4-40 UNC(4X)) will only appear once under the MEASURING INSTRUMENT USED section, regardless of MI type. This condition is similar to 2)
    (Please refer to cell in blue in the attached workbook), although its MI type is TPG.
    Based on the current formula, it will appear 4 times under section "MEASURING INSTRUMENT USED", similarly to the number of times I have added in the upper section.

    To conclude, i hope my formula can be further modified, so I can also achieve both a) and b), together with 1),2) and 3) conditions.

    Much appreciated.

+ 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. How to prevent download dialog box appearing with vba
    By Alwexis in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-27-2020, 03:07 PM
  2. Prevent error from appearing and code from stopping
    By JRC1 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-17-2017, 05:15 AM
  3. [SOLVED] VBA code required to delete contents of a range and prevent further input.
    By Declamatory in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-07-2014, 05:48 AM
  4. [SOLVED] Prevent matching entries on same row from appearing in the Data Validation dynamic range.
    By Nitefox in forum For Other Platforms(Mac, Google Docs, Mobile OS etc)
    Replies: 6
    Last Post: 12-22-2013, 01:32 PM
  5. Prevent Filepath Appearing When Hovering Over Hyperlink
    By Spencer in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-24-2011, 10:27 AM
  6. [SOLVED] How to prevent Reviewing Toolbar from appearing constantly?
    By korrye in forum Excel General
    Replies: 8
    Last Post: 05-09-2006, 02:30 PM
  7. prevent warning message from appearing
    By Tijmen in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-24-2005, 06:15 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