Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11
Default Returning number of blank cells

First of all, thanks once again for all the help I've been receiving over
the last 2 days.

I have a chart with location(column A) and sales information (rows B to P).
I was asked to prepare a function that would only display the month the
blank cells are in. For example, this is what I have:


Location Oct Nov Dec
123 Main St. 2000 5252
324 Yonge St. 6358 2551
432 James St. 9563


This is what I want:

Location Month Not Paid
123 Main St. Dec
324 Yonge St. Nov
432 James St. Nov, Dec


If there's another way I should be going about doing this, please feel free
to advise. Thanks once again.


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,441
Default Returning number of blank cells

Peter,

A custom User-Defined-Function is the best solution for what you want.

Copy the code below and put it into a codemodule in the same workbook as
your data table. Then use the function like this in cell E2 (reflecting the
structure of your sample data table in A1:D4):

=Report($A$1:$D$1,A2:D2)

Copy the formula down to match your data table, and you're done.

HTH,
Bernie
MS Excel MVP

Function Report(Months As Range, payments As Range) As String
Dim i As Integer
If Months.Cells.Count < payments.Cells.Count Then
Report = "Unequal size ranges"
Else
Report = payments.Cells(1).Value & " "
For i = 2 To payments.Cells.Count
If payments.Cells(i).Value = "" Then
Report = Report & Months.Cells(i).Value & ", "
End If
Next i
If Right(Report, 2) = ", " Then
Report = Left(Report, Len(Report) - 2)
End If
End If
End Function


"Peter McCaul" wrote in message
...
First of all, thanks once again for all the help I've been receiving over
the last 2 days.

I have a chart with location(column A) and sales information (rows B to

P).
I was asked to prepare a function that would only display the month the
blank cells are in. For example, this is what I have:


Location Oct Nov Dec
123 Main St. 2000 5252
324 Yonge St. 6358 2551
432 James St. 9563


This is what I want:

Location Month Not Paid
123 Main St. Dec
324 Yonge St. Nov
432 James St. Nov, Dec


If there's another way I should be going about doing this, please feel

free
to advise. Thanks once again.




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11
Default Returning number of blank cells

Hey Bernie,

Thanks but I have no idea what you're asking me to do. Can you please
digress a bit more? Thanks.


"Bernie Deitrick" <deitbe @ consumer dot org wrote in message
...
Peter,

A custom User-Defined-Function is the best solution for what you want.

Copy the code below and put it into a codemodule in the same workbook as
your data table. Then use the function like this in cell E2 (reflecting

the
structure of your sample data table in A1:D4):

=Report($A$1:$D$1,A2:D2)

Copy the formula down to match your data table, and you're done.

HTH,
Bernie
MS Excel MVP

Function Report(Months As Range, payments As Range) As String
Dim i As Integer
If Months.Cells.Count < payments.Cells.Count Then
Report = "Unequal size ranges"
Else
Report = payments.Cells(1).Value & " "
For i = 2 To payments.Cells.Count
If payments.Cells(i).Value = "" Then
Report = Report & Months.Cells(i).Value & ", "
End If
Next i
If Right(Report, 2) = ", " Then
Report = Left(Report, Len(Report) - 2)
End If
End If
End Function


"Peter McCaul" wrote in message
...
First of all, thanks once again for all the help I've been receiving

over
the last 2 days.

I have a chart with location(column A) and sales information (rows B to

P).
I was asked to prepare a function that would only display the month the
blank cells are in. For example, this is what I have:


Location Oct Nov Dec
123 Main St. 2000 5252
324 Yonge St. 6358 2551
432 James St. 9563


This is what I want:

Location Month Not Paid
123 Main St. Dec
324 Yonge St. Nov
432 James St. Nov, Dec


If there's another way I should be going about doing this, please feel

free
to advise. Thanks once again.






  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,441
Default Returning number of blank cells

Peter,

Sorry, since you were posting to the programming newsgroup I thought you
wanted a programming solution.

Visit both

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

for more information on how to use User-Defined-Functions.

HTH,
Bernie
MS Excel MVP

"Peter McCaul" wrote in message
...
Hey Bernie,

Thanks but I have no idea what you're asking me to do. Can you please
digress a bit more? Thanks.


"Bernie Deitrick" <deitbe @ consumer dot org wrote in message
...
Peter,

A custom User-Defined-Function is the best solution for what you want.

Copy the code below and put it into a codemodule in the same workbook as
your data table. Then use the function like this in cell E2 (reflecting

the
structure of your sample data table in A1:D4):

=Report($A$1:$D$1,A2:D2)

Copy the formula down to match your data table, and you're done.

HTH,
Bernie
MS Excel MVP

Function Report(Months As Range, payments As Range) As String
Dim i As Integer
If Months.Cells.Count < payments.Cells.Count Then
Report = "Unequal size ranges"
Else
Report = payments.Cells(1).Value & " "
For i = 2 To payments.Cells.Count
If payments.Cells(i).Value = "" Then
Report = Report & Months.Cells(i).Value & ", "
End If
Next i
If Right(Report, 2) = ", " Then
Report = Left(Report, Len(Report) - 2)
End If
End If
End Function


"Peter McCaul" wrote in message
...
First of all, thanks once again for all the help I've been receiving

over
the last 2 days.

I have a chart with location(column A) and sales information (rows B

to
P).
I was asked to prepare a function that would only display the month

the
blank cells are in. For example, this is what I have:


Location Oct Nov Dec
123 Main St. 2000 5252
324 Yonge St. 6358 2551
432 James St. 9563


This is what I want:

Location Month Not Paid
123 Main St. Dec
324 Yonge St. Nov
432 James St. Nov, Dec


If there's another way I should be going about doing this, please feel

free
to advise. Thanks once again.








  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11
Default Returning number of blank cells

I do want a programming solution. I just didn't understand what you had
given me. I was hoping you could explain in more detail. It will be
appreciated, thanks.


"Bernie Deitrick" <deitbe @ consumer dot org wrote in message
...
Peter,

Sorry, since you were posting to the programming newsgroup I thought you
wanted a programming solution.

Visit both

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

for more information on how to use User-Defined-Functions.

HTH,
Bernie
MS Excel MVP

"Peter McCaul" wrote in message
...
Hey Bernie,

Thanks but I have no idea what you're asking me to do. Can you please
digress a bit more? Thanks.


"Bernie Deitrick" <deitbe @ consumer dot org wrote in message
...
Peter,

A custom User-Defined-Function is the best solution for what you want.

Copy the code below and put it into a codemodule in the same workbook

as
your data table. Then use the function like this in cell E2

(reflecting
the
structure of your sample data table in A1:D4):

=Report($A$1:$D$1,A2:D2)

Copy the formula down to match your data table, and you're done.

HTH,
Bernie
MS Excel MVP

Function Report(Months As Range, payments As Range) As String
Dim i As Integer
If Months.Cells.Count < payments.Cells.Count Then
Report = "Unequal size ranges"
Else
Report = payments.Cells(1).Value & " "
For i = 2 To payments.Cells.Count
If payments.Cells(i).Value = "" Then
Report = Report & Months.Cells(i).Value & ", "
End If
Next i
If Right(Report, 2) = ", " Then
Report = Left(Report, Len(Report) - 2)
End If
End If
End Function


"Peter McCaul" wrote in message
...
First of all, thanks once again for all the help I've been receiving

over
the last 2 days.

I have a chart with location(column A) and sales information (rows B

to
P).
I was asked to prepare a function that would only display the month

the
blank cells are in. For example, this is what I have:


Location Oct Nov Dec
123 Main St. 2000 5252
324 Yonge St. 6358 2551
432 James St. 9563


This is what I want:

Location Month Not Paid
123 Main St. Dec
324 Yonge St. Nov
432 James St. Nov, Dec


If there's another way I should be going about doing this, please

feel
free
to advise. Thanks once again.












  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,441
Default Returning number of blank cells

Peter,

Visit the two links for instructions on how to use the code that I posted
previously.

HTH,
Bernie
MS Excel MVP

"Peter McCaul" wrote in message
...
I do want a programming solution. I just didn't understand what you had
given me. I was hoping you could explain in more detail. It will be
appreciated, thanks.



  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11
Default Returning number of blank cells

Hey Bernie,

Sorry for bugging you. I went back to your suggestion. After reading it a
few times, i think i understand what you wanted me to do. Anyways, the code
is enter into a module and the formula I've placed in cell e2 (next to the
chart). I get the #name? error when I press enter. I've retyped it a few
times, even copied and paste what you typed but to no avail. Any help is
appreciated, thanks.
"Bernie Deitrick" <deitbe @ consumer dot org wrote in message
...
Peter,

Visit the two links for instructions on how to use the code that I posted
previously.

HTH,
Bernie
MS Excel MVP

"Peter McCaul" wrote in message
...
I do want a programming solution. I just didn't understand what you had
given me. I was hoping you could explain in more detail. It will be
appreciated, thanks.





  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,441
Default Returning number of blank cells

Peter,

I will send you a working version to your hotmail address.

HTH,
Bernie
MS Excel MVP

"Peter McCaul" wrote in message
...
Hey Bernie,

Sorry for bugging you. I went back to your suggestion. After reading it

a
few times, i think i understand what you wanted me to do. Anyways, the

code
is enter into a module and the formula I've placed in cell e2 (next to the
chart). I get the #name? error when I press enter. I've retyped it a few
times, even copied and paste what you typed but to no avail. Any help is
appreciated, thanks.
"Bernie Deitrick" <deitbe @ consumer dot org wrote in message
...
Peter,

Visit the two links for instructions on how to use the code that I

posted
previously.

HTH,
Bernie
MS Excel MVP

"Peter McCaul" wrote in message
...
I do want a programming solution. I just didn't understand what you

had
given me. I was hoping you could explain in more detail. It will be
appreciated, thanks.







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
Returning last number(time) in a row of cells v1rt8 Excel Discussion (Misc queries) 4 December 7th 09 02:15 AM
Why are some cells returning blank when I import external data? enoakes Excel Discussion (Misc queries) 0 May 23rd 08 01:33 PM
Maximum Number of Blank Cells between Non Blank Cells in a Range Mal Excel Worksheet Functions 5 November 3rd 07 08:21 AM
returning blank cells in an IF function Squeky Excel Worksheet Functions 1 January 26th 06 01:54 AM
returning blank cells menphee Excel Discussion (Misc queries) 2 August 27th 05 06:23 AM


All times are GMT +1. The time now is 02:29 PM.

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"