+ Reply to Thread
Results 1 to 9 of 9

Lessonwise question generator

  1. #1
    Registered User
    Join Date
    07-27-2010
    Location
    India
    MS-Off Ver
    Excel 2019
    Posts
    62

    Lessonwise question generator

    Hi team

    I have 4 tabs named lesson 1 to lesson 4 respectively. In each lesson i have 3 types of questions namely Choose, True/False and Questions. In the output tab i have to generate the questions by asking the user how many question to generate from each lesson for each type of questions. I have attached the sample data sheet. I plan to add different type of questions once you guys solve this, I'm sure i will be able to add more types of questions.

    A macro or any formula using Vlookup would be fine. Have it your way.

    Thanks in advance.
    Attached Files Attached Files

  2. #2
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,099

    Re: Lessonwise question generator

    This is really confusing... What is your expected result? Column A? Something else? What is the relevance of the stuff in F to J?
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU

  3. #3
    Registered User
    Join Date
    07-27-2010
    Location
    India
    MS-Off Ver
    Excel 2019
    Posts
    62

    Re: Lessonwise question generator

    Sorry about the random function i just copy pasted the sample data. In each lesson the column B, D and F should be pulled up to the output sheet.

    In the output tab, Column F to J: The user needs to type the number of questions for each lesson and according to that input the questions should be generated.

    Finally the expected result should show in the Output tab: column A.
    Last edited by meetgilbert; 12-17-2019 at 09:08 AM.

  4. #4
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,588

    Re: Lessonwise question generator

    I feel as if this would be easier if the questions were on one sheet and in fact one column.
    In the attached file I put the questions from lessons 1 and 2 on the Lesson 1 sheet.
    The questions are in column D
    The lesson and questions type are in column C (type .1 = choose, .2 = T/F, .3 = question)
    The RAND() function populates column B
    Column A is populated using: =SUMPRODUCT((C$2:C$55=C2)*(B$2:B$55>B2))+1
    Column E displays the questions that have been selected using: =IF(A2<=F$1,"S","")
    Note that cell F1 needs to be manually populated with the number of questions from each lesson/type that will be used.
    The selected questions are displayed in column M using*: =IF(ROWS(A$1:A1)<=G$1,INDEX(D$2:D$55,SMALL(IF(E$2:E$55="S",ROW(D$2:D$55)-ROW(D$1)),ROWS(A$1:A1))),"")
    *Denotes an array entered formula which is confirmed by pressing CTRL+SHIFT+ENTER to activate the array, not just ENTER. You will know the array is active when you see curly braces { } appear around your formula. If you do not CTRL+SHIFT+ENTER you will get an error or a clearly incorrect answer.
    Note that G1 is populated using: =F1*COUNTIF(A2:A55,1)
    Column L numbers the questions using: =IF(M2<>"",SUM(L1,1),"")
    Note that custom formatting 0. is applied to column L
    Columns L and M could be moved to a separate sheet.
    I believe that all functions used are supported in the 2003 version of Excel, although the .xlsx file format is not, so I imagine you are actually using another version (please update your profile if that is the case).
    Let us know if you have any questions.
    Attached Files Attached Files
    Consider taking the time to add to the reputation of everybody that has taken the time to respond to your query.

  5. #5
    Registered User
    Join Date
    07-27-2010
    Location
    India
    MS-Off Ver
    Excel 2019
    Posts
    62

    Re: Lessonwise question generator

    @JeteMc (Forum Guru)...Excellent solution...i will take it over from here. I've understood everything what you have said. I have updated my excel version. Thank you so much.

  6. #6
    Registered User
    Join Date
    07-27-2010
    Location
    India
    MS-Off Ver
    Excel 2019
    Posts
    62

    Re: Lessonwise question generator

    one last question: For each lesson under each question type if i need to select the number of questions how do i do that ? For example in the excel sheet that you have modified, lesson type 1.1 i have to select one question and lesson type 2.1 I want to select one question and then the output should come in the column M..

  7. #7
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,588

    Re: Lessonwise question generator

    First, since you are using the 2019 version we can rewrite the formula in column M to read (not an array entered formula):
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    Note that cell I1 contains: =SUM(G2:G15)
    Assuming that you still want the questions picked randomly (modeled in attached file):
    1. Place the Lesson.Types in column F
    2. Type the number of questions you want to select from each Lesson.Type in column G
    3. Modify the formula in column E to read: =IF(A2<=INDEX(G$2:G$7,MATCH(C2,F$2:F$7,0)),"S","")
    If on the other hand you want to pick the questions manually, delete the formula in column E and type an s in column E corresponding to the row of the selected question.
    Let us know if you have any questions.
    Attached Files Attached Files

  8. #8
    Registered User
    Join Date
    07-27-2010
    Location
    India
    MS-Off Ver
    Excel 2019
    Posts
    62

    Re: Lessonwise question generator

    you made my day. This is exactly what I wanted to do. Merry Christmas JeteMc !

  9. #9
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,588

    Re: Lessonwise question generator

    You're Welcome. Thank You for the feedback and for marking the thread as 'Solved'. I hope that you have a blessed day and a Merry Christmas.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Random Question Paper Generator
    By Harrytheb in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 12-01-2020, 08:08 AM
  2. Random number generator question
    By Losguapos1 in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 06-06-2017, 10:52 AM
  3. Macro random question generator in more than one column
    By tancho321 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 09-26-2016, 03:43 PM
  4. Multiple choice question paper generator
    By thanveer1 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-15-2016, 03:18 AM
  5. Question Generator with Exclusion of Asked Questions
    By jrueff in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 12-06-2015, 06:06 AM
  6. Subtraction Question Generator
    By daqddyo1 in forum Excel - New Users/Basics
    Replies: 2
    Last Post: 03-09-2012, 11:23 AM
  7. Random Number Generator Question...
    By chriz2000 in forum Excel General
    Replies: 0
    Last Post: 07-21-2007, 09:41 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1