+ Reply to Thread
Results 1 to 10 of 10

Removing zero values from dynamic data

Hybrid View

  1. #1
    Registered User
    Join Date
    10-09-2013
    Location
    Dorset, United Kingdom
    MS-Off Ver
    Office 365 on Windows 7 Pro
    Posts
    17

    Removing zero values from dynamic data

    Hello,

    Years ago, someone very kindly write an array formula that took data from a column and condensed it down, removing any zero values. Column A might have a 10-20 pieces of data in it, spread out down 150 rows. The remainder of the cells all have a zero value. The tricky thing is that column A would be dynamic, taking the data from another work sheet. The formula that was given to me was:

    =INDEX(AI$170:AI$177, SMALL(IF(ISNUMBER(AI$170:AI$177)+ISERROR(AI$170:AI$177), numeric, ROW(AI$170:AI$177)-MIN(ROW(AI$170:AI$177))+1), ROW(1:1)))

    This worked brilliantly, but I now need to do the same with a column of numbers and obviously the above won't work as it is for text. I have tried making some changes, but can't seem to get it to work.

    If anyone is able to amend the formula above or write a new one to get it working, it would be brilliant!

    Thank you.

  2. #2
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2406
    Posts
    44,662

    Re: Removing zero values from dynamic data

    Will you please attach a SMALL sample Excel workbook (10-20 rows of data is usually enough)? However, please give us an indication of the approximate number of rows of data you want the solution to work with (100, 1000, 100,000 or whatever). Please don't attach a picture of an Excel sheet (no-one will want to re-type all your stuff before starting).

    1. Make sure that your sample data are truly REPRESENTATIVE of your real data. The use of unrepresentative data is very frustrating and can lead to long delays in reaching a solution.

    2. Make sure that your desired solution is also shown (mock up the results manually).

    3. Make sure that all confidential information is removed first!!

    4. Try to avoid using merged cells. They cause lots of problems!

    Unfortunately the attachment icon doesn't work at the moment. So, to attach an Excel file you have to do the following: Just before posting, scroll down to Go Advanced and then scroll down to Manage Attachments. Now follow the instructions at the top of that screen.
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU

  3. #3
    Registered User
    Join Date
    10-09-2013
    Location
    Dorset, United Kingdom
    MS-Off Ver
    Office 365 on Windows 7 Pro
    Posts
    17

    Re: Removing zero values from dynamic data

    Hello Glenn,

    Thank you. The bit I am trying to do is only 8 cells, but I will copy it loads of times into different parts of the worksheet. I have attached the whole workbook because I wasn't sure if where the data came from would make a difference. Hope this isn't a pain.

    The bit I am trying to solve is on the the "Workings" tab, cells AG169:AJ177

    Just in case, zero values are hidden.

    Thank you, thank you, thank you!
    Attached Files Attached Files

  4. #4
    Forum Guru Bo_Ry's Avatar
    Join Date
    09-10-2018
    Location
    Thailand
    MS-Off Ver
    MS 365
    Posts
    7,222

    Re: Removing zero values from dynamic data

    Please try at AJ170 and copy down

    =IFERROR(INDEX(AH:AH,AGGREGATE(15,6,ROW($AH$170:$AH$177)/($AH$170:$AH$177<>0),ROWS(AJ$170:AJ170))),"")

    or with Ctrl+Shift+Enter

    =IFERROR(INDEX(AH:AH,SMALL(IF($AH$170:$AH$177<>0,ROW($AH$170:$AH$177)),ROWS(AJ$170:AJ170))),"")

  5. #5
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2406
    Posts
    44,662

    Re: Removing zero values from dynamic data

    Oh!! there are much better ways to do what you want!!

    In AG10, copied down:
    =IFERROR(INDEX($B:$B,AGGREGATE(15,6,ROW($B$10:$B$159)/($AD$10:$AD$159="TT"),ROWS(AG$10:AG10))),"")

    In AH10, copied across and down:
    =IFERROR(VLOOKUP($AG10,$B:$AB,COLUMNS($A:B),FALSE),"")

    I also did Table 1, so you can see what needs to change as you move across.
    Attached Files Attached Files

  6. #6
    Registered User
    Join Date
    10-09-2013
    Location
    Dorset, United Kingdom
    MS-Off Ver
    Office 365 on Windows 7 Pro
    Posts
    17

    Re: Removing zero values from dynamic data

    Brilliant, brilliant, brilliant!

    Not only have you done what I needed but you have simplified it beautifully. Thank you so much.

  7. #7
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2406
    Posts
    44,662

    Re: Removing zero values from dynamic data

    LoL. You're welcome!!

  8. #8
    Registered User
    Join Date
    10-09-2013
    Location
    Dorset, United Kingdom
    MS-Off Ver
    Office 365 on Windows 7 Pro
    Posts
    17

    Re: Removing zero values from dynamic data

    Dear Glenn (or anyone else!),

    I finished the spreadsheet that you kindly helped me with - please don't judge, I am sure you will hate the way that I did the rest of it, very clumsy! This spreadsheet was to help with food orders for a party in a hotel - automatically creating place cards with choices, a food table plan which lists the food for each table for the chefs and a display copy of the table plan.

    I thought it was working perfectly, but there seems to be a problem with part of the spreadsheet –the kitchen order tab seems to be pulling through the wrong orders.

    At first I thought it was a couple of tables (2 and 6) that must have been linking to the wrong cells; the rest of the tables seemed to be working fine, but when I changed the table numbers for the people sitting on table 2 to any other table number, the food order was still wrong.

    For example, if you look at Sarah on table 1 (number 38 on the list) – it says she is having soup, but when this goes across the right (BY12) it says she is having Vinny. It is also wrong for her main course and dessert.

    The formula that is pulling the data through is

    =IFERROR(VLOOKUP($BY10,$B:$AB,COLUMNS($A:B),FALSE),"")

    and then filled down.

    The spreadsheet is attached. Did I get the formula wrong somehow? Any help would be wonderful!

    Thanks, Jon
    Attached Files Attached Files

  9. #9
    Forum Guru Bo_Ry's Avatar
    Join Date
    09-10-2018
    Location
    Thailand
    MS-Off Ver
    MS 365
    Posts
    7,222

    Re: Removing zero values from dynamic data

    There are 31 Sarah and 38 Sarah, Vlookup(,,,,FALSE) will pick the first one.
    You will need to change Name to Sarah A and Sarah B

    or try at BZ10 to match name with table no.

    =IFERROR(INDEX(C$10:C$159,MATCH($BY10&MID($BY$8,7,2),INDEX($B$10:$B$159&$AD$10:$AD$159,),)),"")

  10. #10
    Registered User
    Join Date
    10-09-2013
    Location
    Dorset, United Kingdom
    MS-Off Ver
    Office 365 on Windows 7 Pro
    Posts
    17

    Re: Removing zero values from dynamic data

    Hello Bo_Ry,

    That is wonderful, thank you. It didn't occur to me that duplicates might be causing it. I have copied your formula and it is now working on the entire sheet.

    Jon

+ 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. Replies: 2
    Last Post: 10-31-2016, 09:09 AM
  2. Removing n/a values from vlookup data
    By peakd in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 07-19-2016, 04:56 PM
  3. Summarizing Data by removing zeroed values
    By Coxy347 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 02-11-2015, 10:54 PM
  4. How do I maintain data values while removing external links?
    By Alice_F_Quinton in forum Excel General
    Replies: 1
    Last Post: 04-07-2014, 02:14 PM
  5. [SOLVED] Data Analysis: Comparing 3 columns, sorting, removing unique values, display data
    By kmills2626 in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 10-14-2013, 07:27 AM
  6. Removing Dynamic Data
    By Jennifer10 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 01-21-2010, 09:15 AM
  7. Removing Data from Pivot with zero values
    By robertguy in forum Excel General
    Replies: 3
    Last Post: 04-23-2009, 03:17 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