+ Reply to Thread
Results 1 to 6 of 6

3 different cells, 1 random value

  1. #1
    Registered User
    Join Date
    09-02-2014
    Location
    Berlin, Germany
    MS-Off Ver
    2007
    Posts
    2

    3 different cells, 1 random value

    Hey guys,

    I have a quick question

    I have 3 cells - A1,A2 and A3. ONE of these cells will contain a random value (depending on a condition that is already scripted). Now I want that random value, which can be in any of those 3 cells, to be in a new cell (A4 f.e.). How would that work?


    Kind regards
    Steffi

  2. #2
    Valued Forum Contributor TheCman81's Avatar
    Join Date
    11-06-2012
    Location
    Edinburgh, UK
    MS-Off Ver
    Excel 2003, 2007, 2010, 2013
    Posts
    346

    Re: 3 different cells, 1 random value

    Will A1:A3 only have 1 value and the other 2 blank?

    if so just use =SUM(A1:A3)

    If not, can you supply some sample data

    Thanks
    Excel Guru in the making

    <----------If the question has been answered to your satisfication please click the Add Repuation star to the left

  3. #3
    Registered User
    Join Date
    09-02-2014
    Location
    Berlin, Germany
    MS-Off Ver
    2007
    Posts
    2

    Re: 3 different cells, 1 random value

    Thanks for the reply!

    Yes, only one cell will have a value. But I forgot to mention that it can be a number or a letter (specifically, A1 can only be "1" or blank, A2 can either have "X" or blank and A3 may have "2" or blank) .. thus the sum function won't work

  4. #4
    Valued Forum Contributor TheCman81's Avatar
    Join Date
    11-06-2012
    Location
    Edinburgh, UK
    MS-Off Ver
    Excel 2003, 2007, 2010, 2013
    Posts
    346

    Re: 3 different cells, 1 random value

    Use the following array formula, let me know if this is what you need =SUM(IF(ISNUMBER(A1:A3), A1:A3))

  5. #5
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: 3 different cells, 1 random value

    Hi,

    =LOOKUP(1,0/(A1:A3<>""),A1:A3)

    Regards
    Click * below if this answer helped

    Advanced Excel Techniques: http://excelxor.com/

  6. #6
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: 3 different cells, 1 random value

    If there are only 3 cells to check you can also use a nested IF formula.

    =IF(A1<>"",A1,IF(A2<>"",A2,IF(A3<>"",A3,"")))

    The expression <>"" means "is not blank".
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

+ 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. Mirror cells - two worksheets, random cells. Attempted code provided
    By ld2x07 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 06-18-2014, 09:30 AM
  2. [SOLVED] please help with random cells
    By Duckie in forum Excel General
    Replies: 6
    Last Post: 04-13-2012, 02:49 AM
  3. Only two values (numbers) for 150 random cells in a column of 300 cells
    By andrugrasu in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 01-20-2011, 03:17 AM
  4. Average random cells (no array), bypassing cells with zeros
    By Jettero2112 in forum Excel General
    Replies: 7
    Last Post: 12-09-2010, 11:30 AM
  5. Replies: 2
    Last Post: 12-07-2010, 04:29 PM

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