+ Reply to Thread
Results 1 to 10 of 10

Formula to display Odd/Even pattern

Hybrid View

b_rianv Formula to display Odd/Even... 08-22-2014, 03:14 PM
cbatrody Re: Formula to display... 08-22-2014, 03:24 PM
Zodeeak Re: Formula to display... 08-22-2014, 03:28 PM
b_rianv Re: Formula to display... 08-22-2014, 04:16 PM
cbatrody Re: Formula to display... 08-22-2014, 04:23 PM
Tony Valko Re: Formula to display... 08-22-2014, 08:41 PM
b_rianv Re: Formula to display... 08-27-2014, 09:07 PM
Tony Valko Re: Formula to display... 08-27-2014, 09:13 PM
b_rianv Re: Formula to display... 08-27-2014, 09:59 PM
Tony Valko Re: Formula to display... 08-27-2014, 10:07 PM
  1. #1
    Forum Contributor
    Join Date
    06-23-2014
    Location
    USA
    MS-Off Ver
    2010
    Posts
    239

    Formula to display Odd/Even pattern

    I am using excel 2010 and I would like to have a formula to do a "odd/even" pattern for my lottery numbers in a row.
    Example...
    Cells C1:H1 have my lottery drawn numbers (1,2,3,4,5,6) now in cell K1 I would like to see the even/odd pattern like this "OEOEOE" to display. How would I do this??

    I am trying to use this formula but it's not working....=IF(ISEVEN(HLOOKUP(C1:H2,2,0)),"E","O").
    I am getting errors like...#NA or #VALUE or nothing shows up. I am entering it as a array

    Does any one know a formula on how to do this??

    Any help would be great

    Thanks,

  2. #2
    Forum Expert cbatrody's Avatar
    Join Date
    04-15-2014
    Location
    Dubai
    MS-Off Ver
    Microsoft Office 365 ProPlus
    Posts
    2,136

    Re: Formula to display Odd/Even pattern

    Hi,

    Please try the following formula in K1

    =IF(ISODD(C1),"O","E")&IF(ISODD(D1),"O","E")&IF(ISODD(E1),"O","E")&IF(ISODD(F1),"O","E")&IF(ISODD(G1),"O","E")&IF(ISODD(H1),"O","E")

  3. #3
    Registered User
    Join Date
    06-27-2013
    Location
    Boulder, CO
    MS-Off Ver
    Excel 2007
    Posts
    99

    Re: Formula to display Odd/Even pattern

    =CONCATENATE(IF(A1/2=INT(A1/2),"E","O"),IF(B1/2=INT(B1/2),"E","O"),etc. is one way to do it.

    Hope that helps.

    -Z

  4. #4
    Forum Contributor
    Join Date
    06-23-2014
    Location
    USA
    MS-Off Ver
    2010
    Posts
    239

    Re: Formula to display Odd/Even pattern

    Thanks guys both of these formulas work GREAT!!!

    Thank you

  5. #5
    Forum Expert cbatrody's Avatar
    Join Date
    04-15-2014
    Location
    Dubai
    MS-Off Ver
    Microsoft Office 365 ProPlus
    Posts
    2,136

    Re: Formula to display Odd/Even pattern

    You are welcome

    If that takes care of your question, please mark this thread as Solved by selecting Thread Tools --> Mark thread as solved.

  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: Formula to display Odd/Even pattern

    Another possibility that uses a VBA function.

    With your file open...

    Press the key combination of Alt+F11 to open the Visual Basic Editor

    Goto the menu Insert > Module

    Copy the VBA code at this link and paste it into the window that opens on the right side of the screen

    Press the key combination of ALT+Q to close the Visual Basic Editor and return to Excel.

    Data Range
    C
    D
    E
    F
    G
    H
    I
    J
    K
    1
    6
    11
    15
    21
    28
    35
    EOOOEO
    2
    ------
    ------
    ------
    ------
    ------
    ------
    ------
    ------
    ------


    Enter this array formula** in K1:

    =concatall(IF(MOD(C1:H1,2),"O","E"))

    ** array formulas need to be entered using the key
    combination of CTRL,SHIFT,ENTER (not just ENTER).
    Hold down both the CTRL key and the SHIFT key
    then hit ENTER.
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  7. #7
    Forum Contributor
    Join Date
    06-23-2014
    Location
    USA
    MS-Off Ver
    2010
    Posts
    239

    Re: Formula to display Odd/Even pattern

    Mr. Valko,

    I am interested in using the VBA code you have directed me too BUT there are a lot of those VBA code to do what I want to do with my number pattern. Can you tell me which one I should look in to?

    Thank you

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

    Re: Formula to display Odd/Even pattern

    Use the one I linked to.

    It should take you to post #8 in the thread. Use the code in post #8.

  9. #9
    Forum Contributor
    Join Date
    06-23-2014
    Location
    USA
    MS-Off Ver
    2010
    Posts
    239

    Re: Formula to display Odd/Even pattern

    Thank you I will look at it. But I have kind of found a working macro BUT it not only copies my formulas over ,it also copies the values and I am trying to figure out how too stop it from bring out the cell value. Can you take a look??
    Sub Insert2()
     'copy formula from cell H3 to cell H2
     Range("H2").Formula = Range("H3").Formula
     'copy formula from cell I3 to cell I2
     Range("I2").Formula = Range("I3").Formula
     End Sub
    Any help would be great

    Thank you

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

    Re: Formula to display Odd/Even pattern

    I'm not much of a programmer.

    I can copy and use someone else's code but I can't write code myself.

+ 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. Copy down hypertext cell range pattern & cell reference formula pattern
    By Underexcelling in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 01-10-2014, 03:23 AM
  2. [SOLVED] IF formula pattern
    By blaugrana9 in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 10-28-2013, 09:33 AM
  3. How to copy formula and it following a pattern?
    By salvi in forum Excel Formulas & Functions
    Replies: 12
    Last Post: 08-22-2013, 03:23 AM
  4. [SOLVED] Pattern Formula?
    By sixwest in forum Excel General
    Replies: 3
    Last Post: 09-13-2005, 12:05 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