Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 02-12-2012, 04:32 PM
MicronExcel MicronExcel is offline CountIF in R1C1 With Ampersand and Address Reference Windows 7 64bit CountIF in R1C1 With Ampersand and Address Reference Office 2010 64bit
Novice
CountIF in R1C1 With Ampersand and Address Reference
 
Join Date: Feb 2012
Posts: 3
MicronExcel is on a distinguished road
Default CountIF in R1C1 With Ampersand and Address Reference

I'm trying to create a COUNTIF formula with the R1C1 format that should look like the following after being run:

=COUNTIF(I24:I24,"<"&DP24)



I'm having trouble getting the row number variable, "less than" sign, and ampersand to work correctly when all in the same formula. What I have now (below) gives me a Run-time error 1004 (application-defined or object-defined error). Variations of what's below place a hardcoded TRUE/FALSE in the cell. Here is what I have now:

Cells(x, LastColumnNumber + 10).FormulaR1C1 = "=CountIF(R" & x & "C" & 9 & ":R" & x & "C" & LastColumnNumber & ","">"" & " & " & Cells(x, LastColumnNumber + 8).Address)"""

Any suggestions on how to make this work?

Thanks!
Reply With Quote
  #2  
Old 02-12-2012, 05:41 PM
zyzzyva57 zyzzyva57 is offline CountIF in R1C1 With Ampersand and Address Reference Windows 7 32bit CountIF in R1C1 With Ampersand and Address Reference Office 2007
Expert
 
Join Date: Mar 2009
Location: Dawsonville, Ga (NE of Atl)
Posts: 355
zyzzyva57 is on a distinguished road
Default

I think you may have a comma out of place

Here is what I tested with:

=COUNTIF(B1,"<"&TODAY()) = 1

I see with yours perhaps a comma in the wrong place

=COUNTIF(I24:I24,"<"&DP24)
Reply With Quote
  #3  
Old 02-12-2012, 06:14 PM
MicronExcel MicronExcel is offline CountIF in R1C1 With Ampersand and Address Reference Windows 7 64bit CountIF in R1C1 With Ampersand and Address Reference Office 2010 64bit
Novice
CountIF in R1C1 With Ampersand and Address Reference
 
Join Date: Feb 2012
Posts: 3
MicronExcel is on a distinguished road
Default

Do you mean within the macro code or within the final formula I'm trying to have the code produce? The final formula works when I enter it into a cell. It's the code to produce that formula that is giving me trouble (mainly how to show the comma within a R1C1 COUNTIF after a variable column number and how to show an ampersand in the final formula when ampersands are used in creating the code).

Thanks
Reply With Quote
  #4  
Old 02-12-2012, 06:49 PM
MicronExcel MicronExcel is offline CountIF in R1C1 With Ampersand and Address Reference Windows 7 64bit CountIF in R1C1 With Ampersand and Address Reference Office 2010 64bit
Novice
CountIF in R1C1 With Ampersand and Address Reference
 
Join Date: Feb 2012
Posts: 3
MicronExcel is on a distinguished road
Default

FYI--I got it working with the following:

Cells(x, LastColumnNumber + 10).FormulaR1C1 = "=CountIF(R" & x & "C9:R" & x & "C" & LastColumnNumber & ","">""&R" & x & "C" & LastColumnNumber + 8 & ")"
Reply With Quote
Reply

Tags
ampersand, countif, r1c1



Similar Threads
Thread Thread Starter Forum Replies Last Post
COUNTIF and Cell address problem ColinC Excel 3 12-24-2011 04:08 AM
CountIF in R1C1 With Ampersand and Address Reference Vlookup, offset, match & countif jujuwillis Excel 2 10-15-2011 11:06 AM
CountIF in R1C1 With Ampersand and Address Reference Countif with 2 criteria ibrahimaa Excel 3 05-23-2011 11:23 AM
how to read R1C1 formula Suhanti Excel 2 10-16-2010 11:30 AM
CountIF in R1C1 With Ampersand and Address Reference Need Help With SUMIF Formula In R1C1 Style Todd Excel 9 02-27-2010 08:30 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 10:24 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft