Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 34
Default Excel formula for counting nr records with data and related empty fields

Hello,

Somebody can help me out with a formula.

Sheet 1 column B M (Formula with result)
test1 2 / 1
test2 1 / 0
test3 ""

Sheet 2 Column A K
test8 01-03-2012
test2
test1 04-03-2012
test10 05-04-2012
test1
test6

As you can see I need a formula I think (?) based on "Countifs".
In sheet 1 column M I like to have a formula to fill that shows the
number of records in sheet 2 column A with the same text as registered
in the datafield column B of sheet 1.
After this result a 'slash' and there after the results of those same
datafield but then how many of the found identical records have a
enddate registered.

The result of 'test3' is empty because this is not existing in Sheet2.

You get for example "4 / 2". Means: 4 found and 2 of them finished.

regards,
Johan.

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 812
Default Excel formula for counting nr records with data and related empty fields

The following user-defined function should work.

Function MyCountIf(Criteria As Range, Search As Range) As String
Dim iCt As Integer
Dim iCt2 As Integer
Dim c As Range

For Each c In Search
If c = Criteria.Value Then
iCt = iCt + 1
If IsEmpty(c.Offset(0, 10)) = False Then iCt2 = iCt2 + 1
End If
Next c
MyCountIf = iCt & "/" & iCt2
End Function
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 34
Default Excel formula for counting nr records with data and related empty fields

Thanks for the quick reply.

I mis the reference to the mentioned sheets and columns.

The loopfunction is in sheet1: Column B is the reference and Column M
gives the result.
The formula looks in Sheet2 where the counting of the required text
comes from Column A and the counting for the finish date comes from
Column K.

You understand that I need more help :)

regards,
Johan.
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 812
Default Excel formula for counting nr records with data and related empty fields

Maybe you don't understand how to use the function.
Select the cell where you want the result. Using the function prompts
you to select the Criteria and the Search.

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
Formula For Counting Records tb Excel Worksheet Functions 5 October 31st 09 08:09 PM
MAX formula and 'empty fields' David Brereton[_2_] Excel Discussion (Misc queries) 1 August 28th 08 01:44 PM
How keep Excel from counting empty cells when calculating formula Excel Noob Excel Worksheet Functions 6 November 8th 07 11:18 PM
Using vb to paste records from 1 sheet, to related records in another chrisnichols87 Excel Programming 0 January 10th 07 10:59 AM
flip spreadsheet data from row records to column record fields Wasan Excel Discussion (Misc queries) 1 May 27th 05 10:05 PM


All times are GMT +1. The time now is 12:21 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"