Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
Lost in Microbiology
 
Posts: n/a
Default If cell has one value, go to adjacent cell and count

I have an imported text file (roughly 30,000lines). What I need is to see if
a column has the value "SAUR" and if so, count the columns with "S" in the
next 7 rows below it and 2 columns to the right.
  #2   Report Post  
Posted to microsoft.public.excel.misc
Chris Marlow
 
Posts: n/a
Default If cell has one value, go to adjacent cell and count

Hi,

Try,

=IF(RC[-3]="SAUR",COUNTIF(R[1]C[-1]:R[7]C[-1],"S"),0)

I set this up with R1C1 ref style on & put my formula in column 4. My dummy
data was in col 1 (SAUR, <SAUR) & column 3 (S & <S). You will need to tweak
if you can't put the formula there.

Regards,

Chris.

--
Chris Marlow
MCSD.NET, Microsoft Office XP Master


"Lost in Microbiology" wrote:

I have an imported text file (roughly 30,000lines). What I need is to see if
a column has the value "SAUR" and if so, count the columns with "S" in the
next 7 rows below it and 2 columns to the right.

  #3   Report Post  
Posted to microsoft.public.excel.misc
Lost in Microbiology
 
Posts: n/a
Default If cell has one value, go to adjacent cell and count

Chris,

When I paste this into the worksheet, nothing happens. Am I doing something
wrong? Do I run a macro and insert there?

Thanks

"Chris Marlow" wrote:

Hi,

Try,

=IF(RC[-3]="SAUR",COUNTIF(R[1]C[-1]:R[7]C[-1],"S"),0)

I set this up with R1C1 ref style on & put my formula in column 4. My dummy
data was in col 1 (SAUR, <SAUR) & column 3 (S & <S). You will need to tweak
if you can't put the formula there.

Regards,

Chris.

--
Chris Marlow
MCSD.NET, Microsoft Office XP Master


"Lost in Microbiology" wrote:

I have an imported text file (roughly 30,000lines). What I need is to see if
a column has the value "SAUR" and if so, count the columns with "S" in the
next 7 rows below it and 2 columns to the right.

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
Cell Count bombayterror New Users to Excel 2 January 21st 06 09:33 PM
Count on cell for each time it is changed Jelinek Excel Discussion (Misc queries) 3 January 9th 06 02:22 PM
how to count the number of text frequencies and copy to other cell DG Excel Worksheet Functions 1 October 6th 05 07:11 PM
count cell if value present in every other cell + criteria lrbest4x4xfar Excel Worksheet Functions 2 September 26th 05 01:30 AM
Return Count for LAST NonBlank Cell in each Row Sam via OfficeKB.com Excel Worksheet Functions 12 April 17th 05 10:36 PM


All times are GMT +1. The time now is 03:16 AM.

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

About Us

"It's about Microsoft Excel"