Populating the sheets with data from another sheet when criteria is met

Lifecoachlee

New Member
Joined
May 2, 2014
Messages
36
Hi everyone,I need some help here.

Here's my table.


COLUMN ACOLUMN BCOLUMN C
DEALER CODELOCATIONRESULT
ASMART
PBAKEXMILL
ACAPARROS
ASMKTG
AMSERCO
ASIATIC
H-IIXMILL
CSC
CALOSUY
DAETSLK
EGSMDSE
ARIAS WHSE
ARIAS WHSE
METRO MANILA
ARIAS WHSE
PROVINCE
ARIAS WHSE
ARIAS WHSE
METRO MANILA
ARIAS WHSE
PROVINCE
PROVINCE

<tbody>
</tbody>

Is there any formula in excel where you can populate the cells in Column C all dealers which are from Metro Manila and Province?


Thank you for the help.


Many thanks,
Lee
 

Excel Facts

How to total the visible cells?
From the first blank cell below a filtered data set, press Alt+=. Instead of SUM, you will get SUBTOTAL(9,)
C3, control+shift+enter, not just enter, and copy down:
Rich (BB code):
=IFERROR(INDEX($A$3:$A$13,
  SMALL(IF(ISNUMBER(MATCH($B$3:$B$13,{"metro manila","province"},0)),
  ROW($B$3:$B$13)-ROW($B$3)+1),ROWS($C$3:C3))),"")
 
Upvote 0
C3, control+shift+enter, not just enter, and copy down:
Rich (BB code):
=IFERROR(INDEX($A$3:$A$13,
  SMALL(IF(ISNUMBER(MATCH($B$3:$B$13,{"metro manila","province"},0)),
  ROW($B$3:$B$13)-ROW($B$3)+1),ROWS($C$3:C3))),"")

Sir, you're a genius!!!
God bless you, brother!
 
Upvote 0
You're welcome. Glad to help.

Sir Aladin,

I have a follow-up question.

The formula worked but I need to only show single result for each dealer.
I don't want to see a duplicate of each dealer.
In other words,if the same dealer exist for the same location, it will disregard the other.

Is that possible?
 
Last edited:
Upvote 0
Sir Aladin,

I have a follow-up question.

The formula worked but I need to only show single result for each dealer.
I don't want to see a duplicate of each dealer.
In other words,if the same dealer exist for the same location, it will disregard the other.

Is that possible?

Does what you describe happen in the exhibit you posted? If not, can you post an example?
 
Upvote 0
Try this:

Layout

DEALER CODELOCATIONRESULT
ASMARTARIAS WHSEACAPARROS
PBAKEXMILLARIAS WHSEAMSERCO
ACAPARROSMETRO MANILACSC
ASMKTGARIAS WHSEDAETSLK
AMSERCOPROVINCEEGSMDSE
ASIATICARIAS WHSE
H-IIXMILLARIAS WHSE
CSCMETRO MANILA
DAETSLKPROVINCE
DAETSLKPROVINCE
EGSMDSEPROVINCE
***************************************
<colgroup><col width="68" style="width: 51pt; mso-width-source: userset; mso-width-alt: 2486;"> <col width="77" style="width: 58pt; mso-width-source: userset; mso-width-alt: 2816;"> <col width="72" style="width: 54pt; mso-width-source: userset; mso-width-alt: 2633;"> <tbody> </tbody>

Formula

Code:
In C2 - use Enter to enter the formula

=IFERROR(INDEX($A$2:$A$12,MATCH(0,INDEX(COUNTIF(C$1:C1,$A$2:$A$12)+ISERROR(MATCH($B$2:$B$12,{"METRO MANILA","PROVINCE"},0)),),0)),"")

And copy down.

Markmzz
 
Upvote 0
Thank you everyone. I figured it out already.

Sir Aladin, with this formula, can I add another location aside from metro manila and province?


=IFERROR(INDEX($A$3:$A$13, SMALL(IF(ISNUMBER(MATCH($B$3:$B$13,{"metro manila","province"},0)), ROW($B$3:$B$13)-ROW($B$3)+1),ROWS($C$3:C3))),"")</pre>
 
Upvote 0
Thank you everyone. I figured it out already.

Sir Aladin, with this formula, can I add another location aside from metro manila and province?


=IFERROR(INDEX($A$3:$A$13, SMALL(IF(ISNUMBER(MATCH($B$3:$B$13,{"metro manila","province"},0)), ROW($B$3:$B$13)-ROW($B$3)+1),ROWS($C$3:C3))),"")
</PRE>

Yes. Instead of extending the array list in the formula itself, we can use a criteria range, as shown below.

DEALER CODELOCATIONMETRO MANILA
PROVINCE
ASMARTARIAS WHSEPUERTO
PBAKEXMILLARIAS WHSERESULT
ACAPARROSMETRO MANILAACAPARROS
ASMKTGARIAS WHSEAMSERCO
AMSERCOPROVINCECSC
ASIATICARIAS WHSECSC
H-IIXMILLARIAS WHSEDAETSLK
CSCMETRO MANILAEGSMDSE
CALOSUYARIAS WHSE
CSCPUERTO
DAETSLKPROVINCE
EGSMDSEPROVINCE

<COLGROUP><COL style="WIDTH: 89pt; mso-width-source: userset; mso-width-alt: 4238" width=119><COL style="WIDTH: 98pt; mso-width-source: userset; mso-width-alt: 4636" width=130><COL style="WIDTH: 100pt; mso-width-source: userset; mso-width-alt: 4750" width=134><TBODY>
</TBODY>

Define Ivec using Formulas | Name Manager as referring to:
Rich (BB code):
=ROW(Dealers!$A$3:$A$14)-ROW(Dealers!$A$3)+1

Note that this definition is added in order to speed up the processing. Adjust the name of the data sheet Delaers to suit.

As can be seen in the exhibit, C1:C3 houses three criterion locations.

C5, control+shift+enter, not just enter, and copy down:
Rich (BB code):
=IFERROR(INDEX($A$3:$A$14,
  SMALL(IF(ISNUMBER(MATCH($B$3:$B$14,$C$1:$C$3,0)),
  Ivec),ROWS($C$5:C5))),"")

If there are no dealer code that is the same at different locations, keep the foregoing set up as is.

If the same dealer code occurs at different locations and you don't want them to be listed more than once...

C5, control+shift+enter, not just enter, and copy down:
Rich (BB code):
=IFERROR(INDEX($A$3:$A$14,SMALL(IF(FREQUENCY(IF($A$3:$A$14<>"",
  IF(ISNUMBER(MATCH($B$3:$B$14,$C$1:$C$3,0)),
  MATCH($A$3:$A$14,$A$3:$A$14,0))),Ivec),Ivec),
  ROWS($C$5:C5))),"")

See the workbook that implements the foregoing set up:

https://dl.dropboxusercontent.com/u/65698317/Lifecoachlee%20dealer%20sublist.xlsx
 
Upvote 0
Another way:

Layout

DEALER CODELOCATIONRESULTCriteria Range
ASMARTARIAS WHSEASMARTMETRO MANILA
PBAKEXMILLARIAS WHSEPBAKEXMILLPROVINCE
ACAPARROSMETRO MANILAACAPARROSARIAS WHSE
ASMKTGARIAS WHSEASMKTG
AMSERCOPROVINCEAMSERCO
ASIATICARIAS WHSEASIATIC
H-IIXMILLARIAS WHSEH-IIXMILL
CSCMETRO MANILACSC
DAETSLKPROVINCEDAETSLK
DAETSLKPROVINCEEGSMDSE
EGSMDSEPROVINCE
*******************************************************

<tbody>
</tbody>

Formula

Code:
In C2 - use Enter to enter the formula

=IFERROR(INDEX($A$2:$A$12,MATCH(0,INDEX(COUNTIF(C$1:C1,$A$2:$A$12)+ISERROR(MATCH($B$2:$B$12,$E$2:$E$4,0)),),0)),"")

And copy down.

Markmzz
 
Upvote 0

Forum statistics

Threads
1,215,937
Messages
6,127,775
Members
449,406
Latest member
Pavesib

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