Prevent certain input from appearing in a range

Jude_Beh

New Member
Joined
Sep 27, 2022
Messages
1
Office Version
  1. 2013
Platform
  1. Windows
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)

Using my current existing array formula in cell F111:F145:

=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))))))),"")

together with my current formula in cell B111:B145:

=IF(F111="","",IF(AND(F111<>"PG",F111<>"TPG",F111<>"RG",F111<>"TRG",F111<>"GB"),INDIRECT(ADDRESS(AGGREGATE(15,6,ROW($Q$9:$W$18)/($Q$9:$W$18=F111),1),AGGREGATE(15,6,COLUMN($R$9:$X$18)/($Q$9:$W$18=F111),1))),IF(INDEX(B$1:B$109,AGGREGATE(15,6,ROW($F$8:$F$108)/($F$8:$F$108=$F111),COUNTIF($F$110:$F111,$F111)))<>"",INDEX(B$1:B$109,AGGREGATE(15,6,ROW($F$8:$F$108)/($F$8:$F$108=$F111),COUNTIF($F$110:$F111,$F111))),"")))

also in cell D&E111:145

=IF(OR($F111="TPG",$F111="PG",$F111="TRG",$F111="RG",$F111="GB"),IF(INDEX(D$1:D$108,AGGREGATE(15,6,ROW($F$8:$F$108)/($F$8:$F$108=$F111),COUNTIF($F$110:$F111,$F111)))<>"",INDEX(D$1:D$108,AGGREGATE(15,6,ROW($F$8:$F$108)/($F$8:$F$108=$F111),COUNTIF($F$110:$F111,$F111))),""),IF(ISBLANK($F111),"-",""))

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 existing 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.

Jude
 

Attachments

  • 123.png
    123.png
    91.7 KB · Views: 18
  • 56.png
    56.png
    29.6 KB · Views: 19

Excel Facts

Do you hate GETPIVOTDATA?
Prevent GETPIVOTDATA. Select inside a PivotTable. In the Analyze tab of the ribbon, open the dropown next to Options and turn it off

Forum statistics

Threads
1,223,886
Messages
6,175,198
Members
452,617
Latest member
Narendra Babu D

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top