Populate a column based on values in two other columns

RodneyC

Active Member
Joined
Nov 4, 2021
Messages
278
Office Version
  1. 2016
Platform
  1. Windows
I have a list of items in $A$2:$A$15 In column $B$2:$B$15 there is a for the corresponding value in A. The value in column B allows me to define what “group” the item in column A belongs to.

In column E, I want a list of items in each group. From the screen shot below, you can see the idea. I’ve color coded this simply for ease of explanation, no coloring is needed when finished. I’m thinking I may need separate codes for each group. The values in column B are likely to change over time... if I change B2 to 3 instead of 1 as it currently is, it would automatically be moved out of Group 1 into Group 3 in column E

I'm needing something in E2:E5 that looks for items in column B with the value “1” and if it’s there, populate the cells with the appropriate value in column A. I would need a similar formula would be needed for Group 2 and so on.

Thinking ahead, it’s not important what order these are displayed in, I’m assuming it would do it based on the order these are displayed on column A.

Thank you in advance


1644422759179.png
 

Excel Facts

Create a Pivot Table on a Map
If your data has zip codes, postal codes, or city names, select the data and use Insert, 3D Map. (Found to right of chart icons).
Ok, so that's not the problem. If you type =Le into a cell, is LET one of the options?
 
Upvote 0
Ok, that's the problem.
Before I try & re-jig the formula do you have the UNIQUE function?
 
Upvote 0
In that case it sounds as though you are not using xl 365. In which case I would advise updating your profile to show the version that you are using.
 
Upvote 0
Another option for older versions of Excel
+Fluff 1.xlsm
ABCDEFG
1COLORGROUPGroup 1Group 2Group 3
2Green1GreenYellowBlack
3Blue1BlueOrangeWhite
4Yellow2RedTangerineSilver
5Orange2PurpleMagentaLime
6Tangerine2 BrownBanana
7Red1   
8Black3   
9Magenta2
10Brown2
11White3
12Silver3
13Purple1
14Lime3
15Banana3
16
Data
Cell Formulas
RangeFormula
E2:G8E2=IFERROR(INDEX($A$2:$A$15,AGGREGATE(15,6,(ROW($A$2:$A$15)-ROW($A$2)+1)/($B$2:$B$15=COLUMNS($E$2:E$2)),ROWS(E$2:E2))),"")
 
Upvote 0
That worked and profile updated to show Excel 2016, THANK YOU SO MUCH for your help.
 
Upvote 0
You're welcome & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,214,653
Messages
6,120,750
Members
448,989
Latest member
mariah3

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