+ Reply to Thread
Results 1 to 5 of 5

How to have a formula extending over a column but ignore cells resulting in invalid value

  1. #1
    Registered User
    Join Date
    08-28-2018
    Location
    SFO
    MS-Off Ver
    2010
    Posts
    2

    How to have a formula extending over a column but ignore cells resulting in invalid value

    This is a common problem and am assuming many users would have faced this. However, after an exhaustive search over the Internet and in several forums like this, I was not able to find a solution possibly because I'm not able to describe the problem and precise language.

    I am, therefore, posting the query here and I hope I'm able to provide clarity.

    This is the issue:
    let's say I have a simple formula that just divides the number in the cell in an adjacent column with another number in another adjust cell. In other words,for the cell A3, the formula will look like this A3=A2/A1. And for cell B3, B3=B2/B1.

    If B1 is having a value of zero or there is no entry in the cell B1, B3 will result in invalid value.

    Sometimes, due to better readability, I have to leave alternate rows empty.
    So extending the previous example, it will mean something like this:
    A3 = A2/A1 - A1 will have valid values and therefore A3 will have valid values.. Let's assume A1=10, A2 = 10 and therefore A1=1
    the entire row B will have to be kept empty just for readability purposes.So B1 will not have any value and therefore B3 will print invalid value
    C3=C2/C1 - C1 will have valid values and therefore C3 will have valid values. Let's assume C1=10, C2=30 and therefore, C3 will be equal to 3

    And we continue like this down the column. The problem is that since alternate rows are empty, the third column in the empty rows will be putting display invalid values.

    So is there a way that I can create a formula which will ignore any empty rows . And if that is not possible, maybe the formula can exist in every row but invalid values should not be printed

    Right now, I go and manually delete every cell that is printing invalid values and obviously that is not possible to do in large spreadsheets.

    I hope there is a solution to it.

    Thank you for any inputs

  2. #2
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,926

    Re: How to have a formula extending over a column but ignore cells resulting in invalid va

    Hi, welcome to the forum

    IF I understand you correctly, I would probably use a helper column (which you can hide), that would populate a column based on whether the adjacent cell has a value (use that) of not (use the value from the cell above.
    =if(a2="",D1,A2)
    where col D would be the helper column. You can than base your calcs on that.

    If that was not what you wanted, upload a small (clean) sample workbook (not a pic) of what you are working with, and what your expected outcome would look like.
    To attach a file to your post,
    click advanced (next to quick post),
    scroll down until you see "manage file",
    click that and select "add files" (top right corner).
    click "select files" find your file, click "open" click "upload" click 'done" bottom right. click "submit reply"

    Once the upload is completed the file name will appear below the input boxes in this window.
    You can then close the window to return to the new post screen.
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  3. #3
    Registered User
    Join Date
    08-28-2018
    Location
    SFO
    MS-Off Ver
    2010
    Posts
    2

    Re: How to have a formula extending over a column but ignore cells resulting in invalid va

    Thank you for your prompt response. Your solution will work. I will have to learn how to hide a column but I think that is easy to figure out.

    Thank you for understanding my long winded explanation :-)

  4. #4
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,460

    Re: How to have a formula extending over a column but ignore cells resulting in invalid va

    Right-click the column header and choose Hide from the menu.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  5. #5
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,926

    Re: How to have a formula extending over a column but ignore cells resulting in invalid va

    Happy to help, let me know how you make out?

+ 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] Ignore blank cells with formulas or ignore NA() in a formula
    By guiismiti in forum Excel Charting & Pivots
    Replies: 5
    Last Post: 03-24-2016, 02:13 PM
  2. [SOLVED] Formula looking at two separate cells resulting in one cell
    By jkr4250 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 02-11-2013, 11:05 AM
  3. Replies: 3
    Last Post: 11-22-2012, 11:19 PM
  4. Removing Blank Cells Resulting From Formula
    By johndoh453 in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 04-22-2012, 02:33 AM
  5. Extending formula in a column automatically to lower rows
    By cprash_aggarwal in forum Excel General
    Replies: 5
    Last Post: 12-19-2008, 07:15 PM
  6. [SOLVED] Positioning Numeric Values Resulting from 6 Column Array Formula
    By Sam via OfficeKB.com in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 01-04-2006, 10:10 PM

Tags for this Thread

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