Hi, please help
And look into file attachment
Hi, please help
And look into file attachment
Try this
Type Leo in D2
Type PL in D3
Paste into E2
=COUNTIFS(A:A,D2,B:B,">"&DATEVALUE(DAY(NOW())&"/"&MONTH(NOW())&"/" &YEAR(NOW())-20))
Copy E2 to E3
Note that the dates need to be recognized as dates. Suggest using a / instead of a .
mrice, OP's profile (and .xls file upload) indicates 2003. If thats the case, countifS() wont work for them
edit: also, the dates are not dates, but text that looks like dates
edit2:
In C2, copied down, use this to convert to dates...
=SUBSTITUTE(B2,".","/")*1
then for leo use this...
=SUMPRODUCT(($A$2:$A$9="Leo")*($C$2:$C$9>TODAY()-DATE(20,0,0)))
and for PL use this...
=SUMPRODUCT(($A$2:$A$9="PL")*($C$2:$C$9>TODAY()-DATE(20,0,0)))
Last edited by FDibbins; 01-13-2013 at 11:24 AM.
1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
2. If your question is resolved, mark it SOLVED using the thread tools
3. Click on the star if you think someone helped you
Regards
Ford
hi Shermaine2010, an alternative considering that you are using Excel 2003 would be:
=SUMPRODUCT((A2:A9="Leo")*(DATEDIF(DATE(RIGHT(B2:B9,4),MID(B2:B9,4,2),LEFT(B2:B9,2)),TODAY(),"y")<20))
that's for leo
and for PL, just change the one in red:
=SUMPRODUCT((A2:A9="PL")*(DATEDIF(DATE(RIGHT(B2:B9,4),MID(B2:B9,4,2),LEFT(B2:B9,2)),TODAY(),"y")<20))
you can also refer to a cell reference like what mrice has suggested. do note that Leo actually has 4 children under 20
Thanks, if you have clicked on the * and added our rep.
If you're satisfied with the answer, click Thread Tools above your first post, select "Mark your thread as Solved".
"Contentment is not the fulfillment of what you want, but the realization of what you already have."
Tips & Tutorials I Compiled | How to Get Quick & Good Answers
Hi
Another version. In cell C2= Leo & cell C3 = PL. Then in D2 and copy to D3.
Formula:
Please Login or Register to view this content.
Regards Kevin
Merged Cells (They are the work of the devil!!!)
Yes, is text format.
I would like to use Year only to count the year old. any suggestion?
If you only want to compare years, in C2, copied down...
=VALUE(RIGHT(B2,4))
then for Leo use...
=SUMPRODUCT(($A$2:$A$5000="Leo")*($C$2:$C$5000>VALUE(TEXT(TODAY()-DATE(20,0,0),"YYYY"))))
and for PL use...
=SUMPRODUCT(($A$2:$A$5000="PL")*($C$2:$C$5000>VALUE(TEXT(TODAY()-DATE(20,0,0),"YYYY"))))
if you have more than 5000 rows, adjust the 5000 in both cases (see bolded)
in the context of the sample workbook that you uploaded in post #1, following single formula will beget 4 for Leo and 2 for PL:
![]()
Please Login or Register to view this content.
- i.s.z -
CSE, aka Array aka { }, formulae are confirmed with CONTROL+SHIFT+ENTER.
Replace commas ( , ) with semicolons ( ; ) in formulae, if your locale setting demands.
All good ideas are courtesy resources from this forum as well as others around the web.
- e.o.m -
'- ----------
Last edited by Shermaine2010; 01-14-2013 at 08:53 AM.
where did the (Calender!$G$1-RIGHT('Adhoc-famil'!$F$2:$F$16,4)<21 come from??
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks