Thread: loop count
View Single Post
  #2   Report Post  
Duke Carey
 
Posts: n/a
Default

This is a problem that requires recusrion to solve it. It isn't anything
I've done in Excel, but I followed the series of articles here to perform
similar tasks in SQL Server. If you don't have SQL Server, it works just
equally well in MSDE, which is a free, personal version of SQL Server

http://www.windowsitpro.com/SQLServe...123/16123.html


"TUNGANA KURMA RAJU" wrote:

I posted a question yesterday named"count row numbers in loop".Nobody could
solve my problem.I am posting the same with elaborate logic.
A B c(Total persons D (Total females
(name) (code) working under) working under)

1 JOHN 4/M =2 =1
2 CARY 6/M =0 =0
3 LARA 1/M = 1 =1
4 DAVID 0/M = 7 =2
5 LUCY 6/F =1 =0
6 RAO 4/M =3 = 1
7 JAMES 5/M =0 =0
8 CRIS 3/F =0 =0

Range B1:B8 contains codes of range A1:A8 persons.John's code 4/M indicates
he is a male employee and his immediate boss is row(4) person ,that is
DAVID.Row(4) person(DAVID) has 2 subordinates(John & Rao),whose 3
subordinates are(lara,cary,lucy) and their 2 subordinates are (james and
cris),thus total 7persons are working under DAVID.
What formula will get the above results in C1 and D1?
I don't want to add any more columns to my worksheet to get the desired
results.