+ Reply to Thread
Results 1 to 4 of 4

Finding the next real number in a series

  1. #1
    Registered User
    Join Date
    11-30-2011
    Location
    Guelph, Ontario
    MS-Off Ver
    Excel 2007
    Posts
    2

    Post Finding the next real number in a series

    I am trying to write an 'IF" statement that allows me to set N/As within my spreadsheet at the next real number values in order to obtain a continuous string of numbers. As I have a lot of values to convert I would really like to find a code that allows me to set the [if value is fals] as the previous real number.....Is this even possible?

    Example of spread sheet and If statement (The code works fine, but when you have multiple N/As back to back it does not work):

    A C
    45.6833761
    45.6825066
    N/A =IF(A3="N/A",A2,A3)
    N/A
    45.6867965
    45.6868034
    45.6869954
    N/A
    N/A
    N/A


    Any help would be appreciated!!

    S.

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Finding the next real number in a series

    Two formulas.

    C1: =A1
    C2: =IF(A2="N/A", C1, A2)

    Copy C2 downward.
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  3. #3
    Registered User
    Join Date
    11-30-2011
    Location
    Guelph, Ontario
    MS-Off Ver
    Excel 2007
    Posts
    2

    Re: Finding the next real number in a series

    I see how it may work if A1 stayed constant, but the values in the A columns are changing

    If I want A10 = the value in A7 (as it is the next real number)

    The IF(A8="N/A",A7,A8) works if there the value above A8 is a real number but if it is an N/A (like in A9) then it reverts back to N/A.

    so I guess I am wondering if there is a function that I can put into the IF statement that sets the [If_value_false] to a real number...so something like IF(A8="N/A",A7,|x|)

  4. #4
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Finding the next real number in a series

    I think You read formula #2 wrong. Look again.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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