+ Reply to Thread
Results 1 to 3 of 3

How to conditionaly select a cell within an arrray, based on previous selection "Excel"

  1. #1
    Registered User
    Join Date
    05-17-2020
    Location
    Berlin
    MS-Off Ver
    365
    Posts
    1

    Question How to conditionaly select a cell within an arrray, based on previous selection "Excel"

    Hello everyone, first time trying this, I hope someone can help. I have simplified the problem as much as possible. I have the below table (as an example):

    12.png

    Column A has correct statements, and columns B and C do not. I want to randomly select 2 statements, randomly. For the first statement, I am using:

    =IF(RANDBETWEEN(1,3)=1,INDEX(A1:A5,RANDBETWEEN(1,ROWS(A1:A5))),IF(RANDBETWEEN(1,3)=2,INDEX(B1:B5,RANDBETWEEN(1,ROWS(B1:B5))),INDEX(C1:C5,RANDBETWEEN(1,ROWS(C1:C5)))))

    So there is a 1 in 3 chance that the statement comes from one of the columns. But I am stuck on how to select the second statement. This is because I do not want it to come from the same row as the first statement. So if the first statement (true or false, does not matter) is from row 1 about frogs, I do not want the second statement to be about frogs.

    Any ideas? I am not tied to my way of selecting the first statement. If anyone can think of an easier way to select both (either separately or combined) I would be very grateful.
    Last edited by fzaid; 05-17-2020 at 11:01 AM.

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Ipswich, England
    MS-Off Ver
    MS 365 Business (Win 10 - Work) & MS 365 Subscription Insider (Win 10 - Home)
    Posts
    41,410

    Re: conditional selection

    Administrative Note:

    Welcome to the forum.

    We would very much like to help you with your query, however the thread title does not really convey what your request is about. Tell us what you are trying to do, not how you think it should be done.

    Please take a moment to amend your thread title. Make sure that the title properly explains your request. Your title should be explicit and not be generic (this includes function names used without an indication of what you are trying to achieve).

    Please see Forum Rule #1 about proper thread titles and adjust accordingly. To edit the thread title, open the original post to edit and then click on Go Advanced (bottom right) to access the area where you can edit your title.

    (Note: this change is not optional. As you are new, I will do it for you this time.)
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!

    Forum Rules (updated September 2018): please read them here.
    How to use the Power Query code you've been given: help here. More about the Power suite here.
    Don't forget to say "thank you" to those who have helped you in your thread. If you wish, you can also reward them by clicking on their reputation star bottom left.

  3. #3
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Ipswich, England
    MS-Off Ver
    MS 365 Business (Win 10 - Work) & MS 365 Subscription Insider (Win 10 - Home)
    Posts
    41,410

    Re: How to Randomly Select TWO Statements from s Table

    There are instructions at the top of the page explaining how to attach your sample workbook.

+ 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] Conditional Cell Selection
    By aliakbaram85 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 01-28-2018, 03:12 PM
  2. [SOLVED] Conditional Row Selection
    By jsattler in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-10-2014, 07:42 PM
  3. conditional selection
    By murarihyd in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 04-09-2011, 03:49 PM
  4. Excel 2007 : conditional selection of percentage
    By slaata in forum Excel General
    Replies: 2
    Last Post: 08-16-2010, 12:12 PM
  5. conditional selection
    By txtrooper in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-21-2010, 09:23 PM
  6. conditional lookup and selection
    By philiasfogg in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 02-04-2009, 07:21 AM
  7. [SOLVED] Conditional Formatting and selection
    By Kristin N in forum Excel General
    Replies: 2
    Last Post: 09-15-2005, 02:05 PM

Tags for this Thread

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