• Skip to main content
  • Skip to header right navigation
  • Skip to site footer

My Online Training Hub

Learn Dashboards, Excel, Power BI, Power Query, Power Pivot

  • Courses
  • Pricing
    • Free Courses
    • Power BI Course
    • Excel Power Query Course
    • Power Pivot and DAX Course
    • Excel Dashboard Course
    • Excel PivotTable Course – Quick Start
    • Advanced Excel Formulas Course
    • Excel Expert Advanced Excel Training
    • Excel Tables Course
    • Excel, Word, Outlook
    • Financial Modelling Course
    • Excel PivotTable Course
    • Excel for Customer Service Professionals
    • Excel for Operations Management Course
    • Excel for Decision Making Under Uncertainty Course
    • Excel for Finance Course
    • Excel Analysis ToolPak Course
    • Multi-User Pricing
  • Resources
    • Free Downloads
    • Excel Functions Explained
    • Excel Formulas
    • Excel Add-ins
    • IF Function
      • Excel IF Statement Explained
      • Excel IF AND OR Functions
      • IF Formula Builder
    • Time & Dates in Excel
      • Excel Date & Time
      • Calculating Time in Excel
      • Excel Time Calculation Tricks
      • Excel Date and Time Formatting
    • Excel Keyboard Shortcuts
    • Excel Custom Number Format Guide
    • Pivot Tables Guide
    • VLOOKUP Guide
    • ALT Codes
    • Excel VBA & Macros
    • Excel User Forms
    • VBA String Functions
  • Members
    • Login
    • Password Reset
  • Blog
  • Excel Webinars
  • Excel Forum
    • Register as Forum Member

Removing Blanks and or 0s in a range in both columns and rows so the data is organized.|General Excel Questions & Answers|Excel Forum|My Online Training Hub

You are here: Home / Removing Blanks and or 0s in a range in both columns and rows so the data is organized.|General Excel Questions & Answers|Excel Forum|My Online Training Hub
Avatar
sp_LogInOut Log In sp_Registration Register
sp_Search Search
Advanced Search|Last Search Results
Search
Forum Scope




Match



Forum Options



Minimum search word length is 3 characters - maximum search word length is 84 characters
sp_Search Search
sp_RankInfo
Lost password?
sp_CrumbsHome HomeExcel ForumGeneral Excel Questions & Answe…Removing Blanks and or 0s in a ran…
sp_PrintTopic sp_TopicIcon
Removing Blanks and or 0s in a range in both columns and rows so the data is organized.
Avatar
richard hayward
Member
Members
Level 0
Forum Posts: 11
Member Since:
February 8, 2019
sp_UserOfflineSmall Offline
1
February 8, 2019 - 1:43 am
sp_Permalink sp_Print

So before posted I searched the forum to find a relevant topic and found "Excel Remove Blank Cells from a Range" and found a formula which i thought I could used to firstly reove blanks from a column and then hopefully use the same technique to remove the cells form rows as well, however I stumbled at the first hurdle, the original formula was as follows:-  

=IFERROR(INDEX($A$2:$A$9, SMALL(IF(LEN($A$2:$A$9)=0,"", ROW($A$2:$A$9)-MIN(ROW($A$2:$A$9))+1), ROW(A1))),"")

Now this worked just fine when copying the example into a blank worksheet , but when I tried to use it in my sheet  - nothing! The only differences was the location in the spreadsheet (and of course altered the values to reflect the new location, but it will not work for me at all.

 

What I actually have is a spredasheet that needs the blanks or 0 removing form columns and rows, for example see below

 

So in cloumn A & B where there a gaps to remove and from column b in the rows removing all blanks in between.

 

I have uploaded the Test spreadheet which includes the tab that has the example which works.

 

All help gratefully appreciated 

 

Richard

20014267 Rapeseed Oil Bulk 0.004713 E330 Citric Acid 0.000024%          
20008534 Sea Salt 0.004189              
                   
20021332 Bagel Conditioner 2018 0.003142         Ascorbic Acid 0.012567%  
                   
12030050 Calcium Propionate 0.001969              
20011688 RS 190 Star 0.001571              
                   

 

sp_AnswersTopicSeeAnswer See Answer
Avatar
SunnyKow
Puchong, Malaysia

VIP
Members


Trusted Members
Level 8
Forum Posts: 1432
Member Since:
June 25, 2016
sp_UserOfflineSmall Offline
2
February 8, 2019 - 4:45 pm
sp_Permalink sp_Print

Hi Richard

Welcome to the forum.

I think you will need to clean your data first. There are many cells within your data range that looks like blank but are not.

If you press F5 - Special - Constants - OK you will notice that many "blank" cells are selected. I suspect this could be your problem.

Try cleaning up these "blank" cells and see if your formula works.

Sunny

Avatar
richard hayward
Member
Members
Level 0
Forum Posts: 11
Member Since:
February 8, 2019
sp_UserOfflineSmall Offline
3
February 8, 2019 - 5:27 pm
sp_Permalink sp_Print sp_EditHistory

Hi Sunny,

many thanks for the quick reply, alas no this does not work, I cleaned the data before I started and still it does not work  and at the moment I am only concentrating on the first column to get that working but still it does not work, I know it is me that is doing something wrong but its not because the cells are not blank, i even manually cleaned it up on that column. As you can see from the screenshot, the cells above the text are blank and should be removed with the formula (the screenshot was after I did the F5 constants) The formula is in c280.

Richard

🙁

screenshot-of-cleaned-cells-1.jpgImage Enlarger

sp_PlupAttachments Attachments
  • sp_PlupImage screenshot-of-cleaned-cells.jpg (62 KB)
  • sp_PlupImage screenshot-of-cleaned-cells-1.jpg (85 KB)
Avatar
SunnyKow
Puchong, Malaysia

VIP
Members


Trusted Members
Level 8
Forum Posts: 1432
Member Since:
June 25, 2016
sp_UserOfflineSmall Offline
4
February 9, 2019 - 3:19 am
sp_Permalink sp_Print

Hi Richard

In cell B286 (or whatever row that suits your data) enter (array formula)

=IFERROR(INDEX(B$264:B$284, SMALL(IF(LEN(B$264:B$284)=0,"", ROW(B$264:B$284)-MIN(ROW(B$264:B$284))+1), ROW(B1))),"")

Copy down as many rows as needed.

Note that I have removed the $ from $B so that you can copy the formula across multiple columns.

Hope this helps.

Sunny

Avatar
richard hayward
Member
Members
Level 0
Forum Posts: 11
Member Since:
February 8, 2019
sp_UserOfflineSmall Offline
5
February 10, 2019 - 12:39 am
sp_Permalink sp_Print sp_EditHistory

Hi Sunny,

 

Many Many Thanks for your continued support.

Obviously, because of the time difference (Which I am used to as I used to work in Australia and my daughter and her family are still there!), I spent most of yesterday trying to get it to work, and did using your original formula array, I went back to the source data and in the process of making the cells blank I turned off in advanced options any cells with 0 in and converted the formula from If(d81=0,"",c81) to if(d81=0,0,c81), dont really know why this then worked with the array formula but it did and I am very happy, thank you so much.

The only problem i have now is that the array formula does not recognize numbers, so where i have say egg 0.1% and tomato 0.2%, it ignores the numbers completely and I have to have the sub components in order of size in the compound ingredient :(, not sure if you could have  a think about that one? 

many thanks

and Kindest Regards

 

Richard

Avatar
SunnyKow
Puchong, Malaysia

VIP
Members


Trusted Members
Level 8
Forum Posts: 1432
Member Since:
June 25, 2016
sp_UserOfflineSmall Offline
6
February 11, 2019 - 10:18 am
sp_Permalink sp_Print

Hi Richard

I am not clear about your issue with the %.

Can you post some sample with the problem for us to have a clearer picture?

Sunny

Avatar
richard hayward
Member
Members
Level 0
Forum Posts: 11
Member Since:
February 8, 2019
sp_UserOfflineSmall Offline
7
February 11, 2019 - 7:44 pm
sp_Permalink sp_Print

Hi Sunny,

 

Ignore previous request, all is working fine, Many thanks for all your help, you are a complete and utter star 🙂

 

Kindest Regards

 

Richard

Avatar
SunnyKow
Puchong, Malaysia

VIP
Members


Trusted Members
Level 8
Forum Posts: 1432
Member Since:
June 25, 2016
sp_UserOfflineSmall Offline
8
February 12, 2019 - 1:49 am
sp_Permalink sp_Print

Thanks for the compliment.Embarassed

Glad I was able to help.

Sunny

sp_AnswersTopicAnswer
Answers Post
sp_Feed
Go to top
Forum Timezone: Australia/Brisbane
Most Users Ever Online: 245
Currently Online: Andy Kirby, Ben Hughes, Francis Drouillard
Guest(s) 9
Currently Browsing this Page:
1 Guest(s)
Top Posters:
SunnyKow: 1432
Anders Sehlstedt: 870
Purfleet: 412
Frans Visser: 346
David_Ng: 306
lea cohen: 219
A.Maurizio: 202
Jessica Stewart: 202
Aye Mu: 201
jaryszek: 183
Newest Members:
yashal minahil
Oluwadamilola Ogun
Yannik H
dectator mang
Francis Drouillard
Orlando Inocente
Jovitha Clemence
Maloxat Axmatovna
Ricardo Freitas
Marko Meglic
Forum Stats:
Groups: 3
Forums: 24
Topics: 6201
Posts: 27185

 

Member Stats:
Guest Posters: 49
Members: 31861
Moderators: 3
Admins: 4
Administrators: Mynda Treacy, Philip Treacy, Catalin Bombea, FT
Moderators: MOTH Support, Velouria, Riny van Eekelen
© Simple:Press —sp_Information

Sidebar

Blog Categories

  • Excel
  • Excel Charts
  • Excel Dashboard
  • Excel Formulas
  • Excel PivotTables
  • Excel Shortcuts
  • Excel VBA
  • General Tips
  • Online Training
  • Outlook
  • Power Apps
  • Power Automate
  • Power BI
  • Power Pivot
  • Power Query
microsoft mvp logo
trustpilot excellent rating
Secured by Sucuri Badge
MyOnlineTrainingHub on YouTube Mynda Treacy on Linked In Mynda Treacy on Instagram Mynda Treacy on Twitter Mynda Treacy on Pinterest MyOnlineTrainingHub on Facebook
 

Company

  • About My Online Training Hub
  • Disclosure Statement
  • Frequently Asked Questions
  • Guarantee
  • Privacy Policy
  • Terms & Conditions
  • Testimonials
  • Become an Affiliate

Support

  • Contact
  • Forum
  • Helpdesk - For Technical Issues

Copyright © 2023 · My Online Training Hub · All Rights Reserved. Microsoft and the Microsoft Office logo are trademarks or registered trademarks of Microsoft Corporation in the United States and/or other countries. Product names, logos, brands, and other trademarks featured or referred to within this website are the property of their respective trademark holders.