PC Review


Reply
Thread Tools Rate Thread

CountIF and OFFSET

 
 
Steve Jackson
Guest
Posts: n/a
 
      26th Oct 2004
I am trying to create a 2 part formula. The first bit, I need the
formula to find the occurances of a word within a range of cells (e.g.
F3:J10).

That is straight forward using the =COUNTIF(Range,Reference) formula
and brings back the correct result. However the 2nd part is causing me
trouble, where I am trying to do this: For every time the word occurs
I need the formula to count the number in the cell that is one column
to the right.

e.g.
Range of cells is "F3:K10"
Specified word is "Cabbage"
Cabbage appears in cells F5, H8 and J9
The numbers in Cells G5, I8 and K9 are 1, 2 and 1
The formula should bring back the answer 4 (i.e.1+2+1)
All other cells in the range are scanned but ignored because the word
cabbage does not appear.

I need the formula to say, yes I see where Cabbage appears and I will
count the numbers that are in the cells that are 1 column to the
right.

I have tried using OFFSET function within the COUNTIF function but it
brings back the wrong answer. Is it best to use these combined
functions?If so, how?

Any help would be much appreciated.

Steve
 
Reply With Quote
 
 
 
 
Frank Kabel
Guest
Posts: n/a
 
      26th Oct 2004
Hi
=SUMIF(Range,Reference,Sum_Range)

--
Regards
Frank Kabel
Frankfurt, Germany

"Steve Jackson" <(E-Mail Removed)> schrieb im Newsbeitrag
news:(E-Mail Removed)...
> I am trying to create a 2 part formula. The first bit, I need the
> formula to find the occurances of a word within a range of cells

(e.g.
> F3:J10).
>
> That is straight forward using the =COUNTIF(Range,Reference) formula
> and brings back the correct result. However the 2nd part is causing

me
> trouble, where I am trying to do this: For every time the word occurs
> I need the formula to count the number in the cell that is one column
> to the right.
>
> e.g.
> Range of cells is "F3:K10"
> Specified word is "Cabbage"
> Cabbage appears in cells F5, H8 and J9
> The numbers in Cells G5, I8 and K9 are 1, 2 and 1
> The formula should bring back the answer 4 (i.e.1+2+1)
> All other cells in the range are scanned but ignored because the word
> cabbage does not appear.
>
> I need the formula to say, yes I see where Cabbage appears and I will
> count the numbers that are in the cells that are 1 column to the
> right.
>
> I have tried using OFFSET function within the COUNTIF function but it
> brings back the wrong answer. Is it best to use these combined
> functions?If so, how?
>
> Any help would be much appreciated.
>
> Steve


 
Reply With Quote
 
=?Utf-8?B?UGVvIFNqb2Jsb20=?=
Guest
Posts: n/a
 
      26th Oct 2004
Use SUMIF

=SUMIF(Range1,"Cabbage",Range2)

Regards,

Peo Sjoblom


"Steve Jackson" wrote:

> I am trying to create a 2 part formula. The first bit, I need the
> formula to find the occurances of a word within a range of cells (e.g.
> F3:J10).
>
> That is straight forward using the =COUNTIF(Range,Reference) formula
> and brings back the correct result. However the 2nd part is causing me
> trouble, where I am trying to do this: For every time the word occurs
> I need the formula to count the number in the cell that is one column
> to the right.
>
> e.g.
> Range of cells is "F3:K10"
> Specified word is "Cabbage"
> Cabbage appears in cells F5, H8 and J9
> The numbers in Cells G5, I8 and K9 are 1, 2 and 1
> The formula should bring back the answer 4 (i.e.1+2+1)
> All other cells in the range are scanned but ignored because the word
> cabbage does not appear.
>
> I need the formula to say, yes I see where Cabbage appears and I will
> count the numbers that are in the cells that are 1 column to the
> right.
>
> I have tried using OFFSET function within the COUNTIF function but it
> brings back the wrong answer. Is it best to use these combined
> functions?If so, how?
>
> Any help would be much appreciated.
>
> Steve
>

 
Reply With Quote
 
Steve Jackson
Guest
Posts: n/a
 
      26th Oct 2004
Thank you both for pointing me in the direction of the right function to
use. For the Range2 element I inserted the OFFSET function to give:

=SUMIF(Range,Reference,OFFSET(Range,0,1))

e.g. =SUMIF(A1:Z99,Cabbage,OFFSET(A1:Z99,0,1))

I have several corresponding columns in a block of cells and it comes up
with the correct answer!

"Peo Sjoblom" <(E-Mail Removed)> wrote in message
news:1D903655-03B2-4C7E-A9CC-(E-Mail Removed)...
> Use SUMIF
>
> =SUMIF(Range1,"Cabbage",Range2)
>
> Regards,
>
> Peo Sjoblom
>
>
> "Steve Jackson" wrote:
>
> > I am trying to create a 2 part formula. The first bit, I need the
> > formula to find the occurances of a word within a range of cells (e.g.
> > F3:J10).
> >
> > That is straight forward using the =COUNTIF(Range,Reference) formula
> > and brings back the correct result. However the 2nd part is causing me
> > trouble, where I am trying to do this: For every time the word occurs
> > I need the formula to count the number in the cell that is one column
> > to the right.
> >
> > e.g.
> > Range of cells is "F3:K10"
> > Specified word is "Cabbage"
> > Cabbage appears in cells F5, H8 and J9
> > The numbers in Cells G5, I8 and K9 are 1, 2 and 1
> > The formula should bring back the answer 4 (i.e.1+2+1)
> > All other cells in the range are scanned but ignored because the word
> > cabbage does not appear.
> >
> > I need the formula to say, yes I see where Cabbage appears and I will
> > count the numbers that are in the cells that are 1 column to the
> > right.
> >
> > I have tried using OFFSET function within the COUNTIF function but it
> > brings back the wrong answer. Is it best to use these combined
> > functions?If so, how?
> >
> > Any help would be much appreciated.
> >
> > Steve
> >



 
Reply With Quote
 
RagDyer
Guest
Posts: n/a
 
      26th Oct 2004
Another way:

=SUMPRODUCT(--(A1:Y99="Cabbage"),B1:Z99)
--

HTH,

RD
==============================================
Please keep all correspondence within the Group, so all may benefit!
==============================================


"Peo Sjoblom" <(E-Mail Removed)> wrote in message
news:1D903655-03B2-4C7E-A9CC-(E-Mail Removed)...
Use SUMIF

=SUMIF(Range1,"Cabbage",Range2)

Regards,

Peo Sjoblom


"Steve Jackson" wrote:

> I am trying to create a 2 part formula. The first bit, I need the
> formula to find the occurances of a word within a range of cells (e.g.
> F3:J10).
>
> That is straight forward using the =COUNTIF(Range,Reference) formula
> and brings back the correct result. However the 2nd part is causing me
> trouble, where I am trying to do this: For every time the word occurs
> I need the formula to count the number in the cell that is one column
> to the right.
>
> e.g.
> Range of cells is "F3:K10"
> Specified word is "Cabbage"
> Cabbage appears in cells F5, H8 and J9
> The numbers in Cells G5, I8 and K9 are 1, 2 and 1
> The formula should bring back the answer 4 (i.e.1+2+1)
> All other cells in the range are scanned but ignored because the word
> cabbage does not appear.
>
> I need the formula to say, yes I see where Cabbage appears and I will
> count the numbers that are in the cells that are 1 column to the
> right.
>
> I have tried using OFFSET function within the COUNTIF function but it
> brings back the wrong answer. Is it best to use these combined
> functions?If so, how?
>
> Any help would be much appreciated.
>
> Steve
>


 
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
Offset/Countif question =?Utf-8?B?SmVubnkgQi4=?= Microsoft Excel Misc 4 5th Apr 2007 07:43 PM
2 conditions Countif with offset =?Utf-8?B?U3RAY3k=?= Microsoft Excel Programming 9 26th Jan 2007 11:25 PM
Countif from an offset column stokefolk@gmail.com Microsoft Excel Worksheet Functions 5 15th Sep 2006 12:50 AM
countif/offset problem Scot B Microsoft Excel Discussion 5 9th Dec 2005 06:28 AM
Re: offset countif Vasant Nanavati Microsoft Excel Worksheet Functions 1 6th Aug 2003 03:40 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 11:58 AM.