Fill unique values across columns but repeation allowed in columns

hemakumarmech24

New Member
Joined
Mar 29, 2022
Messages
4
Office Version
  1. 365
  2. 2011
Platform
  1. Windows
Dear Members,

I just wanted to create MCQ Quiz sheet. I submitted a sample screen shot.

I found the unique values using unique command in column 'C'.

Now i wanted to fill option 2,3,4(i.e F2,G2,H2) from unique answers (column 'C'.)in random manner, with option 1 (E2) always being the answer I.e Cell B2. No repeation across columns but in rows repeation allowed.

I just tried rand, rand between, index,match function to create random values for this,I'm always getting either same value or ! Value error.

How to use the functions correctly in this scenario. PFA screenshot

thanks in advance
 

Attachments

  • Screenshot_20220329-190734~(1).jpg
    Screenshot_20220329-190734~(1).jpg
    135.9 KB · Views: 5
  • Screenshot_20220329-184548~(1).jpg
    Screenshot_20220329-184548~(1).jpg
    113.9 KB · Views: 7

Excel Facts

Bring active cell back into view
Start at A1 and select to A9999 while writing a formula, you can't see A1 anymore. Press Ctrl+Backspace to bring active cell into view.
Hi & welcome to MrExcel.
For xl 365 how about
+Fluff 1.xlsm
ABCDEFGH
1
21AAADBC
32BBBADC
43CCCDAE
54DDDBCA
65EEECAB
76DDCBE
87CCEBD
98AABED
109BBDCE
1110CCBEA
12
Data
Cell Formulas
RangeFormula
C2:C6C2=UNIQUE(B2:B11)
E2:E11E2=INDEX(B2:B11,)
F2:H11F2=LET(f,FILTER($C$2#,$C$2#<>E2),INDEX(SORTBY(f,RANDARRAY(ROWS(f))),{1,2,3}))
Dynamic array formulas.
 
Upvote 0
Dear sir

The formula worked perfectly fine.Thanks a lot sir., i need one more clarification.

if i add date in columns a and b, like shown in table . the unique column 'c' has to be dynamically updated and the options1,2,3,4,5 also dynamically updated up to last cells in column 'a' and 'b'. Hope you understand my english and Thanks for the immediate response much appreciated...

TEST.xlsx
ABCDEFGHI
1QUESTIONSANSWERSUNIQUEOPTION 1OPTION 2OPTION 3OPTION 4OPTION 5
21AAABCED
32BBBDACE
43CCCEDAB
54DDDEBAC
65EEEADBC
76DDACEB
87CCDEAB
98AAECBD
109BBEDAC
1110CCABED
1211X
1312Y
1413Z
1514X
1615Y
Sheet2
Cell Formulas
RangeFormula
C2:C6C2=UNIQUE(B2:B11)
E2:E11E2=INDEX(B2:B11,)
F2:I11F2=LET(f,FILTER($C$2#,$C$2#<>E2),INDEX(SORTBY(f,RANDARRAY(ROWS(f))),{1,2,3,4}))
Dynamic array formulas.
 
Upvote 0
How about
+Fluff 1.xlsm
ABCDEFGHI
1QUESTIONSANSWERSUNIQUEOPTION 1OPTION 2OPTION 3OPTION 4OPTION 5
21AAAEXYB
32BBBDEAX
43CCCADEB
54DDDACBX
65EEEXYBD
76DXDYBEX
87CYCYXEA
98AZABZXY
109BBZXED
1110CCABDE
1211XXZYBD
1312YYZBDA
1413ZZEAYC
1514XXCAYB
1615YYEACZ
17 
18 
19 
20 
21 
Data
Cell Formulas
RangeFormula
C2:C9C2=UNIQUE(FILTER(B2:B100,B2:B100<>""))
E2:E16E2=FILTER(B2:B100,B2:B100<>"")
F17:F21,F2:I16F2=LET(f,FILTER($C$2#,$C$2#<>E2),IF(E2="","",INDEX(SORTBY(f,RANDARRAY(ROWS(f))),{1,2,3,4})))
Dynamic array formulas.
 
Upvote 0
Solution
How about
+Fluff 1.xlsm
ABCDEFGHI
1QUESTIONSANSWERSUNIQUEOPTION 1OPTION 2OPTION 3OPTION 4OPTION 5
21AAAEXYB
32BBBDEAX
43CCCADEB
54DDDACBX
65EEEXYBD
76DXDYBEX
87CYCYXEA
98AZABZXY
109BBZXED
1110CCABDE
1211XXZYBD
1312YYZBDA
1413ZZEAYC
1514XXCAYB
1615YYEACZ
17 
18 
19 
20 
21 
Data
Cell Formulas
RangeFormula
C2:C9C2=UNIQUE(FILTER(B2:B100,B2:B100<>""))
E2:E16E2=FILTER(B2:B100,B2:B100<>"")
F17:F21,F2:I16F2=LET(f,FILTER($C$2#,$C$2#<>E2),IF(E2="","",INDEX(SORTBY(f,RANDARRAY(ROWS(f))),{1,2,3,4})))
Dynamic array formulas.
Sir the highlighted cells not dynamically updating i.e F17,G17,I17

TEST.xlsx
ABCDEFGHI
1QUESTIONSANSWERSUNIQUEOPTION 1OPTION 2OPTION 3OPTION 4OPTION 5
21AAAXECD
32BBBACXY
43CCCEBAY
54DDDCEaaB
65EEECABY
76DXDBCEA
87CYCEYBA
98AZAZCBX
109BaaBXCED
1110CCYXaaB
1211XXCZYD
1312YYaaZBX
1413ZZAXBY
1514XXBYCE
1615YYDEaaB
1716aaaa
Sheet2
Cell Formulas
RangeFormula
C2:C10C2=UNIQUE(FILTER(B2:B1000,B2:B1000<>""))
E2:E17E2=FILTER(B2:B1000,B2:B1000<>"")
F2:I16F2=LET(f,FILTER($C$2#,$C$2#<>E2),IF(E2="","",INDEX(SORTBY(f,RANDARRAY(ROWS(f))),{1,2,3,4})))
Dynamic array formulas.
 
Upvote 0
Sir the highlighted cells not dynamically updating i.e F17,G17,I17

TEST.xlsx
ABCDEFGHI
1QUESTIONSANSWERSUNIQUEOPTION 1OPTION 2OPTION 3OPTION 4OPTION 5
21AAAXECD
32BBBACXY
43CCCEBAY
54DDDCEaaB
65EEECABY
76DXDBCEA
87CYCEYBA
98AZAZCBX
109BaaBXCED
1110CCYXaaB
1211XXCZYD
1312YYaaZBX
1413ZZAXBY
1514XXBYCE
1615YYDEaaB
1716aaaa
Sheet2
Cell Formulas
RangeFormula
C2:C10C2=UNIQUE(FILTER(B2:B1000,B2:B1000<>""))
E2:E17E2=FILTER(B2:B1000,B2:B1000<>"")
F2:I16F2=LET(f,FILTER($C$2#,$C$2#<>E2),IF(E2="","",INDEX(SORTBY(f,RANDARRAY(ROWS(f))),{1,2,3,4})))
Dynamic array formulas.

Dear sir
I dragged down the formula from F2:I100 and it solved the problem. Now everything is working as I expected.
Thank you a million times over for helping me out!
 
Upvote 0

Forum statistics

Threads
1,214,821
Messages
6,121,759
Members
449,048
Latest member
excelknuckles

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