+ Reply to Thread
Results 1 to 11 of 11

Trying to get field to recognize zeros but not Blanks

  1. #1
    Registered User
    Join Date
    01-17-2020
    Location
    Chicago, IL
    MS-Off Ver
    2010
    Posts
    11

    Question Trying to get field to recognize zeros but not Blanks

    I have a large data set of about 70 rows and 150 columns. Rows are client names and columns are week dates going back to jan 2018. Each cell has a # in it. Some of these numbers are zeros and some are blank because that week hasnt happened yet (eg 2020). I also have a graph that has a dropdown associated with it. I want the formula to pull the zeros as zeros, but i want it to pull the blanks as #N/A so the line graph will ignore them when it plots it out. I know excel recognizes blanks as zeros so I am stumped as to how to figure this out. Please help!! I've tried different combinations of isblank and it just wont work. I'm no expert here so in a little over my head.

    UPLOADED SAMPLE

    Column B = sample client names
    Row 3 = dates
    Field = raw data
    Row 86 = the results I'm looking to pull. I want it to pull zeros if there is a true zero in the field, but if there is a blank, i want it to pull #N/A.

    C91 is the drop down selection for the "client", in this case just #s.
    Attached Files Attached Files
    Last edited by dcoughl; 01-17-2020 at 01:15 PM. Reason: Adding attachment

  2. #2
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Trying to get field to recognize zeros but not Blanks

    Hi and welcome to the forum

    Please upload a workbook or a representative cut down copy, anonymised if necessary. It is always easier to advise if we can see your request in its context.

    Show a before and after situation with manually calculated results, explaining which information is data and which is results, and if it's not blindingly obvious how you have arrived at your results some explanatory notes as well.

    To upload a file click the Go Advanced button at the foot of your post, look underneath the post area for the Manage Attachments section and take it from there.
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  3. #3
    Registered User
    Join Date
    01-17-2020
    Location
    Chicago, IL
    MS-Off Ver
    2010
    Posts
    11

    Re: Trying to get field to recognize zeros but not Blanks

    Done, thank you sir.

  4. #4
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,552

    Re: Trying to get field to recognize zeros but not Blanks

    Try the following formula in cell D86 and across: =IF(ISNUMBER(INDEX(D4:D76,MATCH($C91,$B4:$B76,0))),INDEX(D4:D76,MATCH($C91,$B4:$B76,0)),NA())
    Let us know if you have any questions.
    Consider taking the time to add to the reputation of everybody that has taken the time to respond to your query.

  5. #5
    Registered User
    Join Date
    01-17-2020
    Location
    Chicago, IL
    MS-Off Ver
    2010
    Posts
    11

    Re: Trying to get field to recognize zeros but not Blanks

    JeteMc, thank you that worked perfectly. I knew it had to be a combination of ISNUMBER but I am new to Index & Match. Thank you again!

  6. #6
    Registered User
    Join Date
    01-17-2020
    Location
    Chicago, IL
    MS-Off Ver
    2010
    Posts
    11

    Re: Trying to get field to recognize zeros but not Blanks

    JeteMc; this works great for looking up one line item (eg a client name), but how would I alter the formula to gather a SUM of numerous rows. Say those client names are split among 3 locations. NYC, Chicago, LA -- the formula you wrote works great for looking up "Client 1" but if I wanted to do a separate formula that would look up a sum of the clients listed in NYC, how would i do that? I feel like I need a SUMIF somewhere in there but not sure how. I updated the sample attachment accordingly to show what I mean. Thoughts?
    Attached Files Attached Files

  7. #7
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Trying to get field to recognize zeros but not Blanks

    Hi,

    If you're not too far committed to your current data layout then it would be preferable if you arranged the data in a normalised regular 2 dimensional range.
    i.e create columns for

    Date
    Client Name
    City
    Wins

    and add a new row record row for every non zero win.

    Then any and all sorts of analysis and summarisation is available to you when you use a Pivot Table with some field Slicers to filter the data. Then you avoid the need for formulae altogether.

    I've attached an example where I've created a new set of Data and populated it with the first 5 weeks of data just to give you an idea. I've added the Pivot Table and an associated Pivot column chart which changes as you change the PT filters with the slicers.

    You can do a lot with Pivot tables. This is just one example but other statistics can be derived just by changing the Wins Value setting in the PT field list.
    Attached Files Attached Files

  8. #8
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,552

    Re: Trying to get field to recognize zeros but not Blanks

    I believe that Richard has a good suggestion, however I will go ahead and respond to post #6.
    Assuming that all values will be placed in a column at the same time try the following for H97: =IF(E4="",NA(),SUMPRODUCT(($C4:$C76=$F100)*(E4:E76)))
    Notice that after copying to formula over to EG97 some of the cells will display #VALUE errors. I tracked down the value error for cell I97 which is reporting on the week of 7/15/2018. The error results from the zero in cell F17 being text. You can readily identify text values mixed into the data set when you remove the "center" formatting. The actual numbers will display on the right side of the cell while the text will display on the left. In the future you may want to enter data into rows 4:76 without formatting to avoid having to go back through and edit.
    Let us know if you have any questions.

  9. #9
    Registered User
    Join Date
    01-17-2020
    Location
    Chicago, IL
    MS-Off Ver
    2010
    Posts
    11

    Re: Trying to get field to recognize zeros but not Blanks

    Guys, both very helpful, thank you. JeteMc that SUMPRODUCT worked great; thank you. And Richard I will use that for a different look, so thank you both for the help. Also, great tip on the text cells, that was a great trick and will help me a lot.

    Dave

  10. #10
    Registered User
    Join Date
    01-17-2020
    Location
    Chicago, IL
    MS-Off Ver
    2010
    Posts
    11

    Re: Trying to get field to recognize zeros but not Blanks

    Everything works perfectly and the line graphs/dropdowns that I created also flow well. My hope now is to create a filter that will allow the user to select a date range to only show that line graph. I know this can easily be pivoted, but the goal is to allow basic users to easily see a visual line graph of the data based on their selection. Right now the dropdowns work great, but when a selection is made, it shows ALL the data from 7/2018 to present because that is the chart data. Any thought how to add a simple dropdown filter so someone can select "year" or select the week ending dates they wish to view and have the line graph auto-update to that?

  11. #11
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,552

    Re: Trying to get field to recognize zeros but not Blanks

    I feel as if I need to see the current set up of the graph and drop downs. I will also say that there are contributors whom are better at graphs than I, so another option might be to mark this thread as 'Solved' (using the thread tools menu at the top of the page), and open a new thread in the Excel Charting & Pivots forum that specifically addresses graphing between dates.
    Let us know if you have any questions.

+ 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. Ignore Blanks and Zeros
    By Alan_Bernardo in forum Excel General
    Replies: 3
    Last Post: 01-02-2017, 01:05 PM
  2. SpecialCells won't recognize Blanks
    By shawnvw in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-10-2015, 01:54 PM
  3. Filtering out zeros and blanks
    By hbusche in forum Excel Charting & Pivots
    Replies: 4
    Last Post: 07-25-2013, 03:29 PM
  4. [SOLVED] Help with Vlookup blanks and zeros
    By consulttk in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 11-27-2012, 10:40 AM
  5. formulas with blanks and zeros
    By rebraku in forum Excel - New Users/Basics
    Replies: 3
    Last Post: 09-18-2007, 06:39 PM
  6. Replies: 1
    Last Post: 05-04-2005, 02:06 PM
  7. Ignore blanks or zeros
    By gil0730 in forum Excel General
    Replies: 1
    Last Post: 02-03-2005, 12:12 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