# Group number return.

#### serge

##### Well-known Member
Hi everyone,

I have 3 different groups that each one contain numbers.

Group 1 = 5,8,10.
Group 2 = 2,3,6,9.
Group 3 = 1,4,7.

Then in column D there is numbers that are either from group 1,2 or 3.
I'm looking for a formula that will return the group number either 1,2 or3 in G6:I6.

Thank you.
Excel Workbook
CDEFGHIJ
1Group
2123
3
4
5
681
722
873
913
1051
1143
1232
13
Sheet

### Excel Facts

Can you sort left to right?
To sort left-to-right, use the Sort dialog box. Click Options. Choose "Sort left to right"
Cell G6 =IF(OR(\$D6={5,8,10}),1,"")
Cell H6 =IF(OR(\$D6={2,3,6,9}),2,"")
Cell I6=IF(OR(\$D6={1,4,7}),3,"")
If you want the group number returned in the one column use this =IF(OR(\$D6={5,8,10}),1,IF(OR(\$D6={2,3,6,9}),2,IF(OR(\$D6={1,4,7}),3,"")))

All formulas should be copied down as needed.

Dan

Hi Danerida,

Thank you very much for the formulas that's exactly what I needed.

Really appreciate the help.

Serge.

You're most welcome.

Replies
4
Views
213
Replies
3
Views
364
Replies
3
Views
754
Replies
3
Views
412
Replies
0
Views
619

1,202,966
Messages
6,052,846
Members
444,603
Latest member
dustinjmangum

### 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.

### Which adblocker are you using?

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

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