+ Reply to Thread
Results 1 to 10 of 10

If 3 cells are blank return the vaule of another, or return the value of cell with a vaule

  1. #1
    Forum Contributor
    Join Date
    11-07-2014
    Location
    UK
    MS-Off Ver
    2010
    Posts
    126

    If 3 cells are blank return the vaule of another, or return the value of cell with a vaule

    Hi all,

    I am after a little help with the below: -


    In line 1 I have a static value which is either x or blank (this is determined by a formula). Lines 2,3 and 4 are either blank or have the letters b or l in them (again determined by a formula). I am trying to put together a formula where, if cells 2,3 and 4 are blank the value of line 1 is retrieved however, if lines 2,3 or 4 have a value in them that is retrieved rather than line 1.

    I have tried to change b and l to numbers and try a sum at the bottom of all the rows but it is not counting the numbers (potentially as they are from a formula and not typed in).


    1 x x x x x x x x x x x x x x x x x x x x
    2 0 b b b
    3 0 0 0 0 l l l
    4 0 0 0 0 0 0 b b b b

    I hope this makes sense, unfortunately I am unable to upload an example at the moment - I have tried to show an example above (blank cells on lines 2-4 are shown as zero so I could space them out), any help would be appreciated.

    thanks
    Last edited by elleb; 11-16-2017 at 05:34 PM.

  2. #2
    Forum Expert
    Join Date
    03-23-2004
    Location
    London, England
    MS-Off Ver
    Excel 2019
    Posts
    7,064

    Re: If 3 cells are blank return the vaule of another, or return the value of cell with a v

    "if lines 2,3 or 4 have a value in them that is retrieved rather than line 1. "

    So if there is a value in lines 2, 3, or 4
    ONLY ONE OF THOSE LINES will have a value?

    If so, use COUNTA() to determine number of blanks

    =IF(COUNTA(A2:A4)=3,A1,IF(A2<>"",A2,IF(A3<>"",A3,A4)))

    or

    =IF(A2<>"",A2,IF(A3<>"",A3,IF(A4<>"",A4,A1)))
    Regards
    Special-K

    Ensure you describe your problem clearly, I have little time available to solve these problems and do not appreciate numerous changes to them.

  3. #3
    Forum Contributor
    Join Date
    11-07-2014
    Location
    UK
    MS-Off Ver
    2010
    Posts
    126
    Hi,

    Yes there will only be text in one of the three lines. I have tried the formulas attached, the first one brings through line one perfectly but not lines 2-4. The second brings through the values on lines 2-4 but not line 1 (just shows blank)

  4. #4
    Forum Expert
    Join Date
    03-23-2004
    Location
    London, England
    MS-Off Ver
    Excel 2019
    Posts
    7,064

    Re: If 3 cells are blank return the vaule of another, or return the value of cell with a v

    Can you upload a file, even a mockup would suffice.

    Use the Go Advanced option at the bottom of the page then scroll down to Manage Attachments as the "paperclip" method does not work on this forum.

  5. #5
    Forum Contributor
    Join Date
    11-07-2014
    Location
    UK
    MS-Off Ver
    2010
    Posts
    126

    Re: If 3 cells are blank return the vaule of another, or return the value of cell with a v

    Hi,

    sorry for the delay.

    attached is an example, thanks for your help.
    Attached Files Attached Files

  6. #6
    Forum Expert 63falcondude's Avatar
    Join Date
    08-22-2016
    Location
    USA
    MS-Off Ver
    365
    Posts
    6,266

    Re: If 3 cells are blank return the vaule of another, or return the value of cell with a v

    Try this in B12:

    =RIGHT(B8&B9&B10&B11)

  7. #7
    Forum Contributor
    Join Date
    11-07-2014
    Location
    UK
    MS-Off Ver
    2010
    Posts
    126

    Re: If 3 cells are blank return the vaule of another, or return the value of cell with a v

    Hi,

    This retrieved the values in line 11 only, is it because they values are being pulled through by a formula?

  8. #8
    Forum Expert 63falcondude's Avatar
    Join Date
    08-22-2016
    Location
    USA
    MS-Off Ver
    365
    Posts
    6,266

    Re: If 3 cells are blank return the vaule of another, or return the value of cell with a v

    I'm not sure where you went wrong, as the formula in post #6 provides the expected outcome in row 12 of the workbook that you shared in post #5.

    It doesn't matter if the cell is a hard-coded value or the result of a formula.

    See attachment.
    Attached Files Attached Files

  9. #9
    Forum Contributor
    Join Date
    11-07-2014
    Location
    UK
    MS-Off Ver
    2010
    Posts
    126

    Re: If 3 cells are blank return the vaule of another, or return the value of cell with a v

    How strange, you are right it's working on the example but not the actual sheet. I'll start the new sheet again.
    Thanks for all the help

  10. #10
    Forum Expert 63falcondude's Avatar
    Join Date
    08-22-2016
    Location
    USA
    MS-Off Ver
    365
    Posts
    6,266

    Re: If 3 cells are blank return the vaule of another, or return the value of cell with a v

    You're welcome. Thanks for the rep!

    If you're able to create a more representative sample where the suggested formula does not work, we can take a look at it further.

+ 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. [SOLVED] Delete the vaule of certain cells based on changing numbers
    By tepke in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 01-30-2013, 03:40 PM
  2. [SOLVED] CF based on part of cells vaule
    By robert moore in forum Excel General
    Replies: 15
    Last Post: 10-17-2012, 06:58 AM
  3. Return a vaule based on Multiple variables
    By cooperman82 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 09-04-2012, 06:50 AM
  4. Lookup one table and return matching vaule
    By Tcanitbe in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 06-03-2012, 04:51 PM
  5. Corresponging cell against Max Vaule
    By ranjit5311 in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 09-28-2007, 09:25 AM
  6. Using Cell.Vaule in Formula
    By jonn in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-25-2007, 06:39 AM
  7. [SOLVED] Looking and matching vaules to return another vaule
    By JakeMan in forum Excel General
    Replies: 0
    Last Post: 06-29-2006, 11:45 AM
  8. Replies: 3
    Last Post: 01-10-2006, 06:10 AM

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