Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
bruch04
 
Posts: n/a
Default Complicated conditional "countif" formula

Hi. I have several columns labeled "Monitoring Visit 1...Monitoring
Visit 8", but interspersed between them I have columns labeled "Report
Date", with each report being associated with a given Monitoring visit.
In the last column, on each row, I want to count the number of cells
with dates in them, which signifies if a monitoring visit has occurred
or not. I can't do a normal count if, because of the extra Report
columns in between, which have stay where they are. Can anyone lead me
to the right formula? Thanks.

  #2   Report Post  
Bob Phillips
 
Posts: n/a
Default

=SUMPRODUCT(--(LEFT(A$1:O$1,16)="Monitoring Visit"),--(A2:O2<""))

--

HTH

RP
(remove nothere from the email address if mailing direct)


"bruch04" wrote in message
oups.com...
Hi. I have several columns labeled "Monitoring Visit 1...Monitoring
Visit 8", but interspersed between them I have columns labeled "Report
Date", with each report being associated with a given Monitoring visit.
In the last column, on each row, I want to count the number of cells
with dates in them, which signifies if a monitoring visit has occurred
or not. I can't do a normal count if, because of the extra Report
columns in between, which have stay where they are. Can anyone lead me
to the right formula? Thanks.



  #3   Report Post  
Domenic
 
Posts: n/a
Default

Try...

=SUMPRODUCT(--(MOD(COLUMN(A2:P2)-COLUMN(A2),2)=0),--(ISNUMBER(A2:P2)))

Hope this helps!

In article .com,
"bruch04" wrote:

Hi. I have several columns labeled "Monitoring Visit 1...Monitoring
Visit 8", but interspersed between them I have columns labeled "Report
Date", with each report being associated with a given Monitoring visit.
In the last column, on each row, I want to count the number of cells
with dates in them, which signifies if a monitoring visit has occurred
or not. I can't do a normal count if, because of the extra Report
columns in between, which have stay where they are. Can anyone lead me
to the right formula? Thanks.

  #4   Report Post  
bruch04
 
Posts: n/a
Default

Thanks very much for your replies. In the meantime, I've decided to
just format the Monitoring visit columns with a different fill color
and count based on that, but now I have a problem that my UDF is
counting all the colored columns, not just the nonblank ones. Please
be patient with me, I'm pretty new at excel.... My function is called
countbycolor. Can I combine this function with a normal counta or
countif to come up with only nonblank, colored cells? Thanks.

  #5   Report Post  
Bob Phillips
 
Posts: n/a
Default

I would advise against this, the previous way is much more resilient.

--

HTH

RP
(remove nothere from the email address if mailing direct)


"bruch04" wrote in message
oups.com...
Thanks very much for your replies. In the meantime, I've decided to
just format the Monitoring visit columns with a different fill color
and count based on that, but now I have a problem that my UDF is
counting all the colored columns, not just the nonblank ones. Please
be patient with me, I'm pretty new at excel.... My function is called
countbycolor. Can I combine this function with a normal counta or
countif to come up with only nonblank, colored cells? Thanks.





  #6   Report Post  
bruch04
 
Posts: n/a
Default

Okay, I'll try to stick with the first method, but oddly, the formula
you provided above is being evaluated as a constant, even with the "="
in front of it. I can't even get to the formula evaluation stage to
audit it, because it's a "constant". ???

  #7   Report Post  
Bob Phillips
 
Posts: n/a
Default

Sounds like you have formulas switched off. Goto ToolsOptionsView, and
make sure Formulas is not checked.

--

HTH

RP
(remove nothere from the email address if mailing direct)


"bruch04" wrote in message
oups.com...
Okay, I'll try to stick with the first method, but oddly, the formula
you provided above is being evaluated as a constant, even with the "="
in front of it. I can't even get to the formula evaluation stage to
audit it, because it's a "constant". ???



  #8   Report Post  
bruch04
 
Posts: n/a
Default

I know it sounds strange, but I have other formulas in other cells that
are working fine.

Just to make sure though, I went to ToolsOptionsView and it is not
checked.

  #9   Report Post  
bruch04
 
Posts: n/a
Default

AHA! Okay, I got it to work. I ended up using this formula:

=sumproduct((Left($A$1:$A$7,10)="Monitoring")*$A2: $F7<""))

I gave up on the colour formatting after reading your sumproduct page.
Thanks very much for your help.

Kind regards,

  #10   Report Post  
Bob Phillips
 
Posts: n/a
Default

It is odd that that one should work and the previous one didn't, they are
the same, the comparison string and the operator apart.

--

HTH

RP
(remove nothere from the email address if mailing direct)


"bruch04" wrote in message
oups.com...
AHA! Okay, I got it to work. I ended up using this formula:

=sumproduct((Left($A$1:$A$7,10)="Monitoring")*$A2: $F7<""))

I gave up on the colour formatting after reading your sumproduct page.
Thanks very much for your help.

Kind regards,



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
Conditional Formatting formula not acceptable? Thief_ Excel Discussion (Misc queries) 4 July 19th 05 11:54 AM
Using a Formula in a Conditional Statement? Templee1 Excel Worksheet Functions 2 July 14th 05 08:40 PM
COUNTIF formula problems artisanpp Excel Discussion (Misc queries) 2 June 5th 05 01:30 AM
conditional formatting formula Jack Sons Excel Discussion (Misc queries) 6 April 5th 05 09:50 AM
Formula Dependant Conditional Formatting LDanix Excel Discussion (Misc queries) 1 January 13th 05 06:50 PM


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

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"