Need index match to pick number of rows of same criteria without dupicate

forginganewone

Board Regular
Joined
Mar 14, 2018
Messages
64
Sample data :
[TABLE="width: 597"]
<tbody>[TR]
[TD="align: center"]Site Id[/TD]
[TD="align: center"] Invoice[/TD]
[TD="align: center"]PO[/TD]
[TD="align: center"]Region[/TD]
[TD="align: center"]Amount[/TD]
[TD="align: center"]Quantity[/TD]
[TD="align: center"]Discription[/TD]
[TD="align: center"]Sheet 1[/TD]
[TD="align: center"]Sheet 2[/TD]
[/TR]
[TR]
[TD="align: center"]99[/TD]
[TD="align: center"]A23[/TD]
[TD="align: center"]B22[/TD]
[TD="align: center"]C[/TD]
[TD="align: center"]1993[/TD]
[TD="align: center"]3[/TD]
[TD="align: center"]cable[/TD]
[TD="align: center"]cables[/TD]
[TD="align: center"][/TD]
[/TR]
</tbody>[/TABLE]

there will be lots of data like this.

What i want is to be able to use VBA or excel in a new sheet which will take following criterias : sheet name from H2 column( sheet 1), site from A2 column (99), discription from G2 column (cable) and number of rows from F2 column (3).

The trick here is number of rows, as the site id and description will be same for each row in that sheet but other data will be different so i want it to populate 3 rows without repeating any row.

Please ask if more clarification is needed.
 

Excel Facts

Highlight Duplicates
Home, Conditional Formatting, Highlight Cells, Duplicate records, OK to add pink formatting to any duplicates in selected range.
[FONT=&quot]Result : The result going in a new sheet.[/FONT]
[FONT=&quot]Criteria : only two criteria from A2 and G2. H2 is sheet name from which data will be searched and F2 is number of rows which should be picked.[/FONT]
[FONT=&quot]Searching : I will be searching in a sheet with multiple columns. The column of A2 and G2 will be same in that sheet but other coulmns data will be different, so i want a script of formula to search and pick number of rows(F2) on criteria A2 and G2 but do not duplicate the rows.[/FONT]
[FONT=&quot]For example value in F2 is 3, the script/forumla will pick 3 unique rows from sheet(H2) on criteria A2 and G2[/FONT]
 
Upvote 0
Create an illustrative 5-row input sample along with the output which must obtain from that sample.

Here is the example https://expirebox.com/download/3f77999aef31ee1f9ef04e9e89249cb0.html
Note that : Sheet names will also be found from a formula which you can see in breakup sheet I2 cell.

All the sheets such as cables,papers,rocks etc will have alot of data in the format which is shown in Costing sheet but asset and serial numbers will be unique in those sheets.
So i want to something to be able to use criteria and quantities given in breakup sheet and then pick data from sheet name given in h2 cell of breakup sheet.

So lets say quantity for cables is given as 3, lets assume in sheet "cables" there are 10 rows with same site and description but the formula or script should only pick 3 unique rows from the sheet "cables" without duplicating the rows
 
Last edited:
Upvote 0
The file you provide is inadequate. Try to create one which contains just one of the sheets. Let's say that it is Cables. Provide a small amount of data from that sheet along with an output sheet ("Breakup"?) with the desired results from Cables.
 
Upvote 0
The file you provide is inadequate. Try to create one which contains just one of the sheets. Let's say that it is Cables. Provide a small amount of data from that sheet along with an output sheet ("Breakup"?) with the desired results from Cables.

Sir here you go :
https://expirebox.com/download/edf2cae77d1cbd561a5631db03667b11.html

Breakup sheet : from where formula will take criteria from
Cables sheet : from where it will search data
Results sheet : Where output should be given
 
Last edited:
Upvote 0

Forum statistics

Threads
1,224,296
Messages
6,177,741
Members
452,797
Latest member
prophet4see

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