PC Review


Reply
Thread Tools Rate Thread

Countif type thingy...

 
 
=?Utf-8?B?Sm9jaw==?=
Guest
Posts: n/a
 
      18th Jun 2007
Cells A1:A100 may contain "ABC", "DEF" or "GHI"
Cells B1:B100 will contain a date if work on the entries in "A" have been
completed.
I wish to count the number of "ABC"s only if there is a date next to them in
column B in the same row indicating work complete.
I would then like to do the same for "DEF" and "GHI"

--
tia

Jock
 
Reply With Quote
 
 
 
 
Roger Govier
Guest
Posts: n/a
 
      18th Jun 2007
Hi Jock

Try
=SUMPRODUCT(($A$1:$A$100="ABC")*(ISNUMBER($B$1:$B$100)))

Either repeat for DEF and GHI or put the values ABC etc, in cells D1:F1
and use

=SUMPRODUCT(($A$1:$A$100=D$1)*(ISNUMBER($B$1:$B$100)))
and drag across

--
Regards

Roger Govier


"Jock" <(E-Mail Removed)> wrote in message
news:F65D3515-C037-4ED4-A845-(E-Mail Removed)...
> Cells A1:A100 may contain "ABC", "DEF" or "GHI"
> Cells B1:B100 will contain a date if work on the entries in "A" have
> been
> completed.
> I wish to count the number of "ABC"s only if there is a date next to
> them in
> column B in the same row indicating work complete.
> I would then like to do the same for "DEF" and "GHI"
>
> --
> tia
>
> Jock



 
Reply With Quote
 
=?Utf-8?B?Sm9jaw==?=
Guest
Posts: n/a
 
      18th Jun 2007
Thank you Roger, works a treat.
Regards,

Jock


"Roger Govier" wrote:

> Hi Jock
>
> Try
> =SUMPRODUCT(($A$1:$A$100="ABC")*(ISNUMBER($B$1:$B$100)))
>
> Either repeat for DEF and GHI or put the values ABC etc, in cells D1:F1
> and use
>
> =SUMPRODUCT(($A$1:$A$100=D$1)*(ISNUMBER($B$1:$B$100)))
> and drag across
>
> --
> Regards
>
> Roger Govier
>
>
> "Jock" <(E-Mail Removed)> wrote in message
> news:F65D3515-C037-4ED4-A845-(E-Mail Removed)...
> > Cells A1:A100 may contain "ABC", "DEF" or "GHI"
> > Cells B1:B100 will contain a date if work on the entries in "A" have
> > been
> > completed.
> > I wish to count the number of "ABC"s only if there is a date next to
> > them in
> > column B in the same row indicating work complete.
> > I would then like to do the same for "DEF" and "GHI"
> >
> > --
> > tia
> >
> > Jock

>
>
>

 
Reply With Quote
 
=?Utf-8?B?TWlrZSBI?=
Guest
Posts: n/a
 
      18th Jun 2007
Or if you really want to do it with code:-

Sub merged()
searchfor = InputBox("What are we looking for?")
Dim myRange As Range
Set myRange = Range("A1:A100")
For Each c In myRange
c.Select
If c.Value = searchfor And IsDate(Selection.Offset(0, 1).Value) Then
Count = Count + 1
End If
Next
MsgBox (Count & " instances of " & searchfor)
End Sub

"Jock" wrote:

> Cells A1:A100 may contain "ABC", "DEF" or "GHI"
> Cells B1:B100 will contain a date if work on the entries in "A" have been
> completed.
> I wish to count the number of "ABC"s only if there is a date next to them in
> column B in the same row indicating work complete.
> I would then like to do the same for "DEF" and "GHI"
>
> --
> tia
>
> Jock

 
Reply With Quote
 
=?Utf-8?B?Sm9jaw==?=
Guest
Posts: n/a
 
      18th Jun 2007
I'll keep that one on stand by Mike. Thanks


Jock


"Mike H" wrote:

> Or if you really want to do it with code:-
>
> Sub merged()
> searchfor = InputBox("What are we looking for?")
> Dim myRange As Range
> Set myRange = Range("A1:A100")
> For Each c In myRange
> c.Select
> If c.Value = searchfor And IsDate(Selection.Offset(0, 1).Value) Then
> Count = Count + 1
> End If
> Next
> MsgBox (Count & " instances of " & searchfor)
> End Sub
>
> "Jock" wrote:
>
> > Cells A1:A100 may contain "ABC", "DEF" or "GHI"
> > Cells B1:B100 will contain a date if work on the entries in "A" have been
> > completed.
> > I wish to count the number of "ABC"s only if there is a date next to them in
> > column B in the same row indicating work complete.
> > I would then like to do the same for "DEF" and "GHI"
> >
> > --
> > tia
> >
> > Jock

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Vlookup type thingy JockW Microsoft Excel Worksheet Functions 5 16th Oct 2008 10:49 PM
Question on how to do a COUNTIF type of statement GTVT06 Microsoft Excel Programming 1 6th Dec 2006 01:00 PM
COUNTIF() data type problems Kris Microsoft Excel Programming 3 15th Aug 2003 02:20 PM
Re: COUNTIF() data type problems Harlan Grove Microsoft Excel Worksheet Functions 5 15th Aug 2003 12:00 AM
Re: COUNTIF() data type problems Kris Microsoft Excel Worksheet Functions 1 14th Aug 2003 10:13 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 12:03 PM.