ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   excel - formula anb VBA (https://www.excelbanter.com/excel-programming/286900-excel-formula-anb-vba.html)

sjvenz[_6_]

excel - formula anb VBA
 
I have a spreadsheet setup thats downloads data from our DB2tables, this
look at the employees and the days off sick.

I have been able to get everything to work ok but I'm having trouble
with one lot of code and formula.

The row that it look at is "K" and this contains either "-" or dates
that have been taken as ILL eg..

A .... G H I
J K
NAME Start Finish Leave Type Hours
Med Certificate
Joe Smith 01.1.04 05.1.04 ILL 8
-


8

Mrs White 31.12.03 31.12.03 ILL 8
31.12.03-31.12.03
01.1.04 02.1.04 ILL
16 -
03.1.04 03.1.04 ILL
8 03.1.04-03.1.04


OK what I have is

=IF(E3=0,"",IF(IF(A30,COUNTA(SelectData(CONCATENA TE("k",TEXT(ROW(A3),"0")))),"")="-","
",IF(A30,COUNTA(SelectData(CONCATENATE("k",TEXT(R OW(A3),"0")))),"")))

Public Function SelectData(StartCell As String) As Range
Set SelectData = Range(Range(StartCell),
Range(StartCell).End(xlDown))
End Function

But this seems to still count the "-" rather than just the dates

Waht I need to be able to do is count the number of dates or values in
column "K" to the employee but not the "-".


eg

Joe Smith 0
Mrs White 2

Is this possible


---
Message posted from http://www.ExcelForum.com/



All times are GMT +1. The time now is 06:04 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com