+ Reply to Thread
Results 1 to 10 of 10

Data Validation - how to ignore cells with "0" or "-"

  1. #1
    Forum Contributor
    Join Date
    05-23-2014
    Location
    Fredericia, Denmark
    MS-Off Ver
    Windows Office 2013, Excel 10
    Posts
    139

    Data Validation - how to ignore cells with "0" or "-"

    I'm using Data Validation to allow only one of two cells to be used in a multiplication scenario. Another forum member suggested using
    Please Login or Register  to view this content.
    as the Data Validation custom allowable (formula) but unfortunately it also counts "0", "0.0" and "-" (absolute zero). How can I adapt this approach to ignore "0" and "-"?
    Thanks. David

  2. #2
    Forum Expert
    Join Date
    09-11-2014
    Location
    Washington, DC
    MS-Off Ver
    2016
    Posts
    1,907

    Re: Data Validation - how to ignore cells with "0" or "-"

    Can you post a sample workbook?
    Spread the love, add to the Rep

    "None of us are as smart as all of us."

  3. #3
    Forum Contributor
    Join Date
    05-23-2014
    Location
    Fredericia, Denmark
    MS-Off Ver
    Windows Office 2013, Excel 10
    Posts
    139

    Re: Data Validation - how to ignore cells with "0" or "-"

    Yes, here it is attached. Thanks for your help! David
    Attached Files Attached Files

  4. #4
    Forum Expert
    Join Date
    09-11-2014
    Location
    Washington, DC
    MS-Off Ver
    2016
    Posts
    1,907

    Re: Data Validation - how to ignore cells with "0" or "-"

    I'm confused as to what the need for the data validation is. Why use it if you can write a formula in C1 to account for what you need done? What exactly are the conditions to pick either A1 or B1?

  5. #5
    Forum Contributor
    Join Date
    05-23-2014
    Location
    Fredericia, Denmark
    MS-Off Ver
    Windows Office 2013, Excel 10
    Posts
    139

    Re: Data Validation - how to ignore cells with "0" or "-"

    Data validation is required but combined with the formula in C1 was the best I could come up. I tried various configurations of IF(OR, IF(AND conditional statement formulas but failed to come up with one that would work. The data entry into cells A1 and B1 will probably be manual and I simply need a means of blocking entry of non-zero values into both cells. I also would prefer to avoid VBA as this spreadsheet will be used and re-used by many people over time with rows and columns being added perhaps. Can you provide a formula in C1, and perhaps conditional formatting for A1 and B1 that will work?

    Thanks for your input. David

  6. #6
    Forum Contributor
    Join Date
    05-23-2014
    Location
    Fredericia, Denmark
    MS-Off Ver
    Windows Office 2013, Excel 10
    Posts
    139

    Re: Data Validation - how to ignore cells with "0" or "-"

    I meant Data Validation is NOT required.... sorry.

  7. #7
    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: Data Validation - how to ignore cells with "0" or "-"

    Change the countA() to just count()
    countA() will count numbers and text, count() will only count numbers
    then add in SUM() to exculde 0's...
    =AND(SUM(A1:B1)>0,COUNT(A1:B1)=1)
    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

  8. #8
    Forum Contributor
    Join Date
    05-23-2014
    Location
    Fredericia, Denmark
    MS-Off Ver
    Windows Office 2013, Excel 10
    Posts
    139

    Re: Data Validation - how to ignore cells with "0" or "-"

    I pasted
    Please Login or Register  to view this content.
    into both A1 and B1 data validation custom value formulas but I still get an error message when either cell is blank or "0" Did I do something wrong?

    Also, as it turns out, cell B1 always needs to return either a zero or a positive value. Is that hard to do?

    Thanks again for your help! David

  9. #9
    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: Data Validation - how to ignore cells with "0" or "-"

    I still get an error message when either cell is blank or "0" Did I do something wrong?
    Im sorry, I thought that was what you wanted?

  10. #10
    Forum Contributor
    Join Date
    05-23-2014
    Location
    Fredericia, Denmark
    MS-Off Ver
    Windows Office 2013, Excel 10
    Posts
    139

    Re: Data Validation - how to ignore cells with "0" or "-"

    I'M sorry for the confusing description. It's when both A1 and B1 have non-zero values entered (at the same time) that I need the error message to display. And if you know how to always have B1 non-zero values be positive that would also be good to have.

    Thanks again! David

+ 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] Counting data only contains text (ignore mark "-" & "")
    By Jhon Mustofa in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 04-12-2014, 09:45 PM
  2. Replies: 1
    Last Post: 10-23-2013, 05:20 PM
  3. [SOLVED] How to USE """"" cells count """"" change font color
    By austin123456 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 10-09-2013, 06:14 AM
  4. [SOLVED] Data validation: allow entry into a cell if other three cells have "X", "Y" and "Z"?
    By RogerRangeRover in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 01-05-2013, 04:49 AM
  5. [SOLVED] Manually fill up 1 or (some) cells with just "BFW"or"BF" in data validation
    By robke1960 in forum Non English Excel
    Replies: 2
    Last Post: 12-11-2012, 11:31 AM

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