Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 4
Default Only adding nonzeroes

Hello all,

In Excel 2007, have a data array that contains blank lines. Is it possible
to list only the cells with values? Ill give an example:

A1='blank'
A2='blank'
A3=5/5/08
A4='blank'
A5=7/7/08

Can I list this so it ends with: 5/5/08, 7/7/08? I tried CONCATENATE, but
the blanks return ", ". And now I'm lost.
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,646
Default Only adding nonzeroes

Please, post your CONCATENATE formula!
Regards,
Stefi


€˛BryGuy77€¯ ezt Ć*rta:

Hello all,

In Excel 2007, have a data array that contains blank lines. Is it possible
to list only the cells with values? Ill give an example:

A1='blank'
A2='blank'
A3=5/5/08
A4='blank'
A5=7/7/08

Can I list this so it ends with: 5/5/08, 7/7/08? I tried CONCATENATE, but
the blanks return ", ". And now I'm lost.

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 22,906
Default Only adding nonzeroes

To leave out the blank cells you will have to concatenate just the ones with
data.

=A3 & "," & A5

Or use this UDF which ignores blank cells and comma-delimits those with data.

Function ConCatRange(CellBlock As Range) As String
Dim Cell As Range
Dim sbuf As String
For Each Cell In CellBlock
If Len(Cell.text) 0 Then sbuf = sbuf & Cell.text & ","
Next
ConCatRange = Left(sbuf, Len(sbuf) - 1)
End Function

Usage is =concatrange(A1:A5) which returns 5/5/08,7/7/08

If you're not familiar with VBA and macros/functions, see David McRitchie's site
for more on "getting started".

http://www.mvps.org/dmcritchie/excel/getstarted.htm

or Ron de De Bruin's site on where to store macros.

http://www.rondebruin.nl/code.htm

In the meantime..........

First...create a backup copy of your original workbook.

To create a General Module, hit ALT + F11 to open the Visual Basic Editor.

Hit CRTL + r to open Project Explorer.

Find your workbook/project and select it.

Right-click and InsertModule. Paste the code in there. Save the
workbook and hit ALT + Q to return to your workbook.

In a cell enter the formula as shown above in Usage is:


Gord Dibben MS Excel MVP


Gord Dibben MS Excel MVP

On Tue, 20 May 2008 21:54:01 -0700, BryGuy77
wrote:

Hello all,

In Excel 2007, have a data array that contains blank lines. Is it possible
to list only the cells with values? Ill give an example:

A1='blank'
A2='blank'
A3=5/5/08
A4='blank'
A5=7/7/08

Can I list this so it ends with: 5/5/08, 7/7/08? I tried CONCATENATE, but
the blanks return ", ". And now I'm lost.


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Adding Sarah_Lecturer Excel Discussion (Misc queries) 2 April 17th 08 01:46 PM
adding ref # John K Excel Worksheet Functions 2 March 7th 07 06:06 PM
Help with adding 10% Jennifer Excel Worksheet Functions 2 January 31st 07 08:56 PM
adding A.S. Excel Discussion (Misc queries) 1 December 6th 06 09:35 PM
Adding * to the end Lin Light Excel Discussion (Misc queries) 0 March 14th 05 10:41 PM


All times are GMT +1. The time now is 02:20 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"