![]() |
Listing data without blank rows
I have an excel file with 4 work sheets.. in sheet named 'Claim sheet' i
have data (numbers and text) in cells CM10:CM1661 which is entered periodically and deleted via formula linked with other cells in other sheets, the majority of the 1661 rows are normally blank. What i need to do is on sheet named 'Statement' list (starting in cell B10) all data in 'Claim sheet' CM10:CM1661 without the blank rows. The number of rows with data should never be more than 16 at any one time, so on sheet 'Statement' the data can be listed in cells B10:B26. Any help with the right formula will be much appreciated.. |
Listing data without blank rows
I would use the AutoFilter (Data/Filter/AutoFilter) on column CM. Select
column CM, turn on AutoFilter, use non-blank for criteria. Then copy/paste to the other worksheet "Dannycol" wrote: I have an excel file with 4 work sheets.. in sheet named 'Claim sheet' i have data (numbers and text) in cells CM10:CM1661 which is entered periodically and deleted via formula linked with other cells in other sheets, the majority of the 1661 rows are normally blank. What i need to do is on sheet named 'Statement' list (starting in cell B10) all data in 'Claim sheet' CM10:CM1661 without the blank rows. The number of rows with data should never be more than 16 at any one time, so on sheet 'Statement' the data can be listed in cells B10:B26. Any help with the right formula will be much appreciated.. |
Listing data without blank rows
Thanks for advice but this method is not good for me as the data in both
sheets are for viewing or printing only.. Dannycol "JMB" wrote: I would use the AutoFilter (Data/Filter/AutoFilter) on column CM. Select column CM, turn on AutoFilter, use non-blank for criteria. Then copy/paste to the other worksheet "Dannycol" wrote: I have an excel file with 4 work sheets.. in sheet named 'Claim sheet' i have data (numbers and text) in cells CM10:CM1661 which is entered periodically and deleted via formula linked with other cells in other sheets, the majority of the 1661 rows are normally blank. What i need to do is on sheet named 'Statement' list (starting in cell B10) all data in 'Claim sheet' CM10:CM1661 without the blank rows. The number of rows with data should never be more than 16 at any one time, so on sheet 'Statement' the data can be listed in cells B10:B26. Any help with the right formula will be much appreciated.. |
Listing data without blank rows
The sheet is protected so that you cannot use a filter?
In sheet2 enter this somewhere in the first row and hit Control+Shift+Enter and copy down until you get an error. =INDEX(Sheet1!$CM$10:$CM$1661,SMALL(IF(Sheet1!$CM$ 10:$CM$1661<"",ROW(INDIRECT("1:"&ROWS(Sheet1!$CM$ 10:$CM$1661))),""),ROW())) If you cannot enter it in the first row then change ROW() to ROW() - (Your starting row number - 1) "Dannycol" wrote: Thanks for advice but this method is not good for me as the data in both sheets are for viewing or printing only.. Dannycol "JMB" wrote: I would use the AutoFilter (Data/Filter/AutoFilter) on column CM. Select column CM, turn on AutoFilter, use non-blank for criteria. Then copy/paste to the other worksheet "Dannycol" wrote: I have an excel file with 4 work sheets.. in sheet named 'Claim sheet' i have data (numbers and text) in cells CM10:CM1661 which is entered periodically and deleted via formula linked with other cells in other sheets, the majority of the 1661 rows are normally blank. What i need to do is on sheet named 'Statement' list (starting in cell B10) all data in 'Claim sheet' CM10:CM1661 without the blank rows. The number of rows with data should never be more than 16 at any one time, so on sheet 'Statement' the data can be listed in cells B10:B26. Any help with the right formula will be much appreciated.. |
Listing data without blank rows
Thanks again..
I can insert the formula into row 1 and copied it down, this returns the data ok but the blank cells return #NUM. instead of leaving the cells blank? I need the data listing in Statement sheet (sheet 4) starting in row 10 (B10) when i change the formula Row() to Row(10) i get the usual error .. formula contains an error.. Any ideas.. Regards JMB" wrote: The sheet is protected so that you cannot use a filter? In sheet2 enter this somewhere in the first row and hit Control+Shift+Enter and copy down until you get an error. =INDEX(Sheet1!$CM$10:$CM$1661,SMALL(IF(Sheet1!$CM$ 10:$CM$1661<"",ROW(INDIRECT("1:"&ROWS(Sheet1!$CM$ 10:$CM$1661))),""),ROW())) If you cannot enter it in the first row then change ROW() to ROW() - (Your starting row number - 1) "Dannycol" wrote: Thanks for advice but this method is not good for me as the data in both sheets are for viewing or printing only.. Dannycol "JMB" wrote: I would use the AutoFilter (Data/Filter/AutoFilter) on column CM. Select column CM, turn on AutoFilter, use non-blank for criteria. Then copy/paste to the other worksheet "Dannycol" wrote: I have an excel file with 4 work sheets.. in sheet named 'Claim sheet' i have data (numbers and text) in cells CM10:CM1661 which is entered periodically and deleted via formula linked with other cells in other sheets, the majority of the 1661 rows are normally blank. What i need to do is on sheet named 'Statement' list (starting in cell B10) all data in 'Claim sheet' CM10:CM1661 without the blank rows. The number of rows with data should never be more than 16 at any one time, so on sheet 'Statement' the data can be listed in cells B10:B26. Any help with the right formula will be much appreciated.. |
Listing data without blank rows
First of all, ROW(10) is not valid syntax. For what you had in mind the
syntax would be either one of the following (with $$ as necessary): ROW(10:10) ROW(A10) ROWS(1:10) ROWS(A1:A10) However, what you really need for your task is to replace the ROW() expression with ROW()-ROW($A$10)+1 or ROW()-ROW($A$9) For your error handling you have a Conditional Format solution and a modification of JMB's formula solution. With CF you can use FormulaIs and formula for G10 =ISERROR(G10) and set font color to white for this condition. The more complex formula is to trap the error that SMALL might create if ROW()-ROW($A$9) becomes more than the non-blank cells. Thus you need the longer formula: =IF(ISERROR(SMALL(IF(Sheet1!$CM$10:$CM$1661<"",RO W(INDIRECT("1:"&ROWS(Sheet1!$CM$10:$CM$1661))),"") ,ROW()-ROW($A$9))),"",INDEX(Sheet1!$CM$10:$CM$1661,SMALL( IF(Sheet1!$CM$10:$CM$1661<"",ROW(INDIRECT("1:"&RO WS(Sheet1!$CM$10:$CM$1661))),""),ROW()-ROW($A$9)))) Does this help? Kostis Vezerides |
Listing data without blank rows
Vezerid..
Many thanks. i dont fully understand the reasoning, but thanks again, the long formula works great, i've also done the same with a few more columns and changed the cell references, works great... Regards "vezerid" wrote: First of all, ROW(10) is not valid syntax. For what you had in mind the syntax would be either one of the following (with $$ as necessary): ROW(10:10) ROW(A10) ROWS(1:10) ROWS(A1:A10) However, what you really need for your task is to replace the ROW() expression with ROW()-ROW($A$10)+1 or ROW()-ROW($A$9) For your error handling you have a Conditional Format solution and a modification of JMB's formula solution. With CF you can use FormulaIs and formula for G10 =ISERROR(G10) and set font color to white for this condition. The more complex formula is to trap the error that SMALL might create if ROW()-ROW($A$9) becomes more than the non-blank cells. Thus you need the longer formula: =IF(ISERROR(SMALL(IF(Sheet1!$CM$10:$CM$1661<"",RO W(INDIRECT("1:"&ROWS(Sheet1!$CM$10:$CM$1661))),"") ,ROW()-ROW($A$9))),"",INDEX(Sheet1!$CM$10:$CM$1661,SMALL( IF(Sheet1!$CM$10:$CM$1661<"",ROW(INDIRECT("1:"&RO WS(Sheet1!$CM$10:$CM$1661))),""),ROW()-ROW($A$9)))) Does this help? Kostis Vezerides |
Listing data without blank rows
Danny,
the formula JMB suggested had the following skeleton: =INDEX(data,SMALL(IF(conditions),ROW()) The IF(Conditions) is generating a virtual array, which only only includes non-blank rows. So, SMALL(..., ROW()) was to find first the smallest, then the second smallest etc, of this array. If the virtual array has fewer elements than the current row, ROW() will try to find an element that does not exist. Also, if your data start in row 10, the formula would start to find the 10th element, then 11th etc. So, first modification was to subtract 9 from ROW(). We used ROW($A$9) in order to show exactly which cell is used to start the data. This leads us to the formula: =INDEX(data,SMALL(IF(conditions),ROW()-ROW($A$9)) The second modification, which led to this length, was to see which part could create the error, and this would be SMALL. This leads us to the general philosophy of trapping errors: =IF(ISERROR(formula),"",formula). This can be simplified if instead of using the entire formula in ISERROR, we use only the offending part. So your formula became: =IF(ISERROR(LARGE(...),"",modifed_formula) which is what you used. HTH Kostis |
Listing data without blank rows
Many thanks for the info...
Regards "vezerid" wrote: Danny, the formula JMB suggested had the following skeleton: =INDEX(data,SMALL(IF(conditions),ROW()) The IF(Conditions) is generating a virtual array, which only only includes non-blank rows. So, SMALL(..., ROW()) was to find first the smallest, then the second smallest etc, of this array. If the virtual array has fewer elements than the current row, ROW() will try to find an element that does not exist. Also, if your data start in row 10, the formula would start to find the 10th element, then 11th etc. So, first modification was to subtract 9 from ROW(). We used ROW($A$9) in order to show exactly which cell is used to start the data. This leads us to the formula: =INDEX(data,SMALL(IF(conditions),ROW()-ROW($A$9)) The second modification, which led to this length, was to see which part could create the error, and this would be SMALL. This leads us to the general philosophy of trapping errors: =IF(ISERROR(formula),"",formula). This can be simplified if instead of using the entire formula in ISERROR, we use only the offending part. So your formula became: =IF(ISERROR(LARGE(...),"",modifed_formula) which is what you used. HTH Kostis |
All times are GMT +1. The time now is 07:06 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com