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
 
What does the red code refer to?

=IFERROR(INDEX($A$5:$A$18,AGGREGATE(15,6,(ROW($A$5:$A$18)-ROW($A$5)+1)/($B$5:$B$18=COLUMNS($D$5:D$5)),ROWS(D$5:D5))),"")
 
Upvote 0

Excel Facts

Select a hidden cell
Somehide hide payroll data in column G? Press F5. Type G1. Enter. Look in formula bar while you arrow down through G.
The 15 tells the aggregate function to act like the small function & the 6 tells it to ignore errors.
 
Upvote 0

Forum statistics

Threads
1,216,176
Messages
6,129,314
Members
449,501
Latest member
Amriddin

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