+ Reply to Thread
Results 1 to 6 of 6

Function that will return the next cell to the right if the 1st cell is blank?

  1. #1
    Registered User
    Join Date
    04-06-2010
    Location
    London, England
    MS-Off Ver
    Excel 2003
    Posts
    3

    Function that will return the next cell to the right if the 1st cell is blank?

    2463.7 2451.6 2444.5
    2451.6 2444.5 2431.3
    2444.5 2431.3 2436.3
    2431.3 2436.3 2412.7
    2436.3 2412.7 2417.9 2380
    2412.7 2417.9 2380
    2417.9 2380 2366.2
    2380 2366.2 2349.1
    2366.2 2349.1 2373.9
    2349.1 2373.9 2336.9 2335
    2373.9 2336.9 2335

    I have pasted an example of my data above.
    Basically, I want a formula that will return the value in column A, but if this cell is blank, will return the value in column B, and if B is also blank, will return the value in column C etc.
    I have five potential columns of data, and I want it to return the first, and ignore any that come after it.

    If anyone knows how to do this I would really appreciate the help!!

    Regards

  2. #2
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Function that will return the next cell to the right if the 1st cell is blank?

    Try something like:

    =INDEX(A2:E2,MATCH(TRUE,INDEX(A2:E2<>"",0),0))

    copied down

    where A2:E2 is first range
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

  3. #3
    Registered User
    Join Date
    04-06-2010
    Location
    London, England
    MS-Off Ver
    Excel 2003
    Posts
    3

    Re: Function that will return the next cell to the right if the 1st cell is blank?

    Thanks, that returns the value in Column A if there is a value in column A, but if column A is empty, I want it to return the value in column B, or C, or D, or E - depending on which of them is the first with a value in it.

    Regards

  4. #4
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Function that will return the next cell to the right if the 1st cell is blank?

    That formula should do just that.... are the cells truly empty? Or are there spaces.. (spacebar entries).?

  5. #5
    Registered User
    Join Date
    03-28-2010
    Location
    United States
    MS-Off Ver
    Excel 2007
    Posts
    29

    Re: Function that will return the next cell to the right if the 1st cell is blank?

    Hey justineeds,

    I tested the formula and it works like you described. If there is a value in A it returns A. If the value of A is blank, then it returns the next column that is not blank. B, C, D or E to cover your 5 columns of data.

    What is in your A cell? If it is a formula that produces " ", then try this:

    Please Login or Register  to view this content.
    Warm regards,

    Shampoo Monkey

    If you are happy with the results, please add to my reputation by clicking the icon next to the Post # in the bar above this post.

  6. #6
    Registered User
    Join Date
    04-06-2010
    Location
    London, England
    MS-Off Ver
    Excel 2003
    Posts
    3

    Re: Function that will return the next cell to the right if the 1st cell is blank?

    That makes sense, I have a space in my 'blank' cells. I removed the spaces, and this worked perfectly. Thanks very much for your help!!

    Regards

+ 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