+ Reply to Thread
Results 1 to 5 of 5

Randomizer skip empty cells

  1. #1
    Registered User
    Join Date
    03-27-2020
    Location
    Den Bosch, Netherlands
    MS-Off Ver
    Office 365
    Posts
    8

    Randomizer skip empty cells

    Hi there!

    I'm new on this forum and I got a question. I made a randomizer and I would like to know how to skip empty cells. Right now, if a empty cell is selected it will result in a 0. In this case I would like to skip this cell and go on to the next till the randomizer finds a cell with a value. My formula right now is:

    =INDEX($A$2:$A$1000;RANDBETWEEN(1;1000))

    For some reason I can't upload a document..... -> uploaded an example

    Thanks in advance
    Attached Files Attached Files
    Last edited by Loebe; 03-27-2020 at 04:23 AM.

  2. #2
    Forum Guru Kaper's Avatar
    Join Date
    12-14-2013
    Location
    Warsaw, Poland
    MS-Off Ver
    most often: Office 365 in Windows environment
    Posts
    8,613

    Re: Randomizer skip empty cells

    Will you please attach a SMALL sample Excel workbook(s) (10-20 rows of data is usually enough)? Please don't attach a picture of one (no-one will want to re-type all your stuff before starting).

    1. Make sure that your sample data are truly REPRESENTATIVE of your real data. (If trere are typical cases like: all unique values/duplicates could occur, day/night, nobody present/several persons at once, before/on/past due, etc. - please show them all or at least indicate in text) The use of unrepresentative data is very frustrating and can lead to long delays in reaching a solution.

    2. Make sure that your desired solution(s) is/are also shown (mock up the results manually).

    3. Make sure that all confidential/restricted information (either personal or business) like real e-mails, social security numbers, bank accounts, etc. is removed first!!

    To attach an Excel file you have to do the following: Just before posting, scroll down and press Go Advanced button and then scroll down and press Manage Attachments link. Now follow the instructions at the top of that pop-up screen.
    Best Regards,

    Kaper

  3. #3
    Forum Guru Kaper's Avatar
    Join Date
    12-14-2013
    Location
    Warsaw, Poland
    MS-Off Ver
    most often: Office 365 in Windows environment
    Posts
    8,613

    Re: Randomizer skip empty cells

    If example is representative (see point 1 in my previous post) and you just have numbers and then empty cells such formula will do:
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    My doubts are as follows:
    - is representative? (if you have empty cells between filled ones, this formula will not work)
    - now you have choosing with repetitions. Some values appear more than once. In very rare cases, you could end up even with ALL values the same

  4. #4
    Registered User
    Join Date
    03-27-2020
    Location
    Den Bosch, Netherlands
    MS-Off Ver
    Office 365
    Posts
    8

    Re: Randomizer skip empty cells

    This is exactly what I need. The example is representative and column A will often be filled with 500 till 1000 values, so this will work fine if I adjust my range to 1000. Simpler than I thought. Thanks!

  5. #5
    Forum Guru Kaper's Avatar
    Join Date
    12-14-2013
    Location
    Warsaw, Poland
    MS-Off Ver
    most often: Office 365 in Windows environment
    Posts
    8,613

    Re: Randomizer skip empty cells

    Perfect. So the addendum just for those who will find this thread using search tools
    If the colums with the data to be selected have empty cells between values to be selected, then:
    use helper column (of course in real life you could have this helper column somewhere in not visible space, like in column ZZ, or even in a separate worksheet (could be hidden one). In B2:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    and copy down

    if you need random selection without repetitions use in some cell (say D2):
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    if you want random repetitions:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    And copy down
    Attached Files Attached Files

+ 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. skip empty cells from row
    By MrMyagiii in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-12-2018, 07:23 AM
  2. [SOLVED] VlookUp must return value where first entry is and skip the empty cells
    By Colin Smit in forum Excel Formulas & Functions
    Replies: 24
    Last Post: 11-13-2014, 11:17 PM
  3. [SOLVED] VLookUp need to look at first entry and skip empty cells in Col_Index_Num
    By Colin Smit in forum Excel Formulas & Functions
    Replies: 11
    Last Post: 07-10-2014, 06:37 AM
  4. Replies: 4
    Last Post: 03-08-2014, 02:03 PM
  5. Formula/Macro for copying, skip empty cells
    By joscar in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 11-16-2011, 06:04 PM
  6. Excel 2007 : VLOOKUP skip rows with empty cells
    By cl8390 in forum Excel General
    Replies: 3
    Last Post: 06-28-2011, 03:28 PM
  7. Skip empty cells in vlookup-type application
    By cl8390 in forum Excel General
    Replies: 1
    Last Post: 06-27-2011, 04:01 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