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

Workdays for a market open Mon, Wed, Friday?
Yes! Use "0101011" for the weekend argument in NETWORKDAYS.INTL or WORKDAY.INTL. The 7 digits start on Monday. 1 means it is a weekend.
Can you please post the actual data using the XL2BB add-in, rather than just an image.
Otherwise you are relying on members to spend there time re-creating what you already have.
 
Upvote 0
Cool tool! Here it is. There are no formulas currently. No conditional formatting or data validation at this point.

Colors.xlsx
ABCDE
1COLORGROUPGroup 1
2Green1Green
3Blue1Blue
4Yellow2Red
5Orange2Purple
6Tangerine2
7Red1Group 2
8Black3Yellow
9Magenta2Orange
10Brown2Tangerine
11White3Magenta
12Silver3Brown
13Purple1
14Lime3Group 3
15Banana3Black
16White
17Silver
18Lime
19Banana
MR Excel
 
Upvote 0
Thanks for that.
How about
+Fluff 1.xlsm
ABCDE
1COLORGROUP
2Green1Green
3Blue1Blue
4Yellow2Red
5Orange2Purple
6Tangerine2
7Red1Yellow
8Black3Orange
9Magenta2Tangerine
10Brown2Magenta
11White3Brown
12Silver3
13Purple1Black
14Lime3White
15Banana3Silver
16Lime
17Banana
18
Data
Cell Formulas
RangeFormula
E2:E17E2=LET(u,UNIQUE(B2:B15),r,ROWS(u),s,SEQUENCE(ROWS(B2:B15)+r-1,,0),i,INDEX(u,MOD(s,r-1)+1),INDEX(SORT(IFERROR(INDEX(A2:B15,s+1,{1,2}),CHOOSE({1,2},"",i)),2),,1))
Dynamic array formulas.
 
Upvote 0
Copy/pasted

=LET(u,UNIQUE(B2:B15),r,ROWS(u),s,SEQUENCE(ROWS(B2:B15)+r-1,,0),i,INDEX(u,MOD(s,r-1)+1),INDEX(SORT(IFERROR(INDEX(A2:B15,s+1,{1,2}),CHOOSE({1,2},"",i)),2),,1))

verbatim into E2 and I get the Excel pop-up that says "there's a problem with the formula"
 
Upvote 0
Try copying the mini-sheet into a blank sheet using the copy icon
1644426427723.png
 
Upvote 0
When I do that, it populates the columns A and B but for column E it only populates E2 and populates it with what appears to be a text version of the formula. I copy/pasted "Paste special" as "formula" and it's still showing up as text.
 
Upvote 0
Do you normally use commas as the separator in formulae?
 
Upvote 0
I don't have a "normal" I usually refer to something similar I've done before and copy/paste then modify for what I'm trying to do. If it's something new, I reach out here.
 
Upvote 0

Forum statistics

Threads
1,215,222
Messages
6,123,709
Members
449,118
Latest member
MichealRed

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