#1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 16
Default Counting Help

Hopefully someone can help me with this.

I have the following source data, 2 rows and 2 columns.:

A B
1 2 ?
2 1 ?

In column A I would enter a number.
Column B would be a forumla that returns a result, given the data
below.

Then I have the data I want to lookup in, 2 rows and 4 columns (in this
example)

E F G H
1 1 X X
2 2 X

Column E would be a unique number, generated via =ROW()
Column F,G,H would have "X"'s in the column (ie if it was checked off)

Now given that above.
If someone entered a "2" in Column A, Row 1 above, I want a formula
that will search through E1..E2, and if it matches what was entered
(2), then it go through that same row (2) (in this case F2..H2) and
counts all the X's - in this case it would return 1.
If someone entered a "1" A2, it would return "2", since it found "1" in
E1, and thus searched F1..H1 for "X"'s and found 2 of them.

Hopefully that above shows up ok with ugly ascii art to illustrate the
data.
Also - the above is a contrived example, but it relates to a real-world
example im trying to solve.

Any help would be greatly appreciated. I suspect its something along
the lines of using SUMIF, COUNTIF, V/HLOOKUP, etc. Ive come close, but
im kinda stuck on a few parts (namely once i've matches the number the
person entered in column E, i need to do a COUNTIF( on that same ROW -
but i dont know how to find out that row).

Thanks!

  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 16
Default Counting Help

Opps, two mistakes

"If someone entered a "1" A2"
should read
"If someone entered a "1" IN A2"

AND

"and thus searched F1..H1 for "X"'s and found 2 of them"
should read
"and thus searched F1..H1 for "X"'s and found ONE of them"

Sorry

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,886
Default Counting Help

Hi

try
=COUNTIF(OFFSET($E$1,MATCH(A1,$E$1:$E$2)-1,1,1,3),"x")

Amend ranges to suit

--
Regards

Roger Govier


wrote in message
ps.com...
Hopefully someone can help me with this.

I have the following source data, 2 rows and 2 columns.:

A B
1 2 ?
2 1 ?

In column A I would enter a number.
Column B would be a forumla that returns a result, given the data
below.

Then I have the data I want to lookup in, 2 rows and 4 columns (in
this
example)

E F G H
1 1 X X
2 2 X

Column E would be a unique number, generated via =ROW()
Column F,G,H would have "X"'s in the column (ie if it was checked off)

Now given that above.
If someone entered a "2" in Column A, Row 1 above, I want a formula
that will search through E1..E2, and if it matches what was entered
(2), then it go through that same row (2) (in this case F2..H2) and
counts all the X's - in this case it would return 1.
If someone entered a "1" A2, it would return "2", since it found "1"
in
E1, and thus searched F1..H1 for "X"'s and found 2 of them.

Hopefully that above shows up ok with ugly ascii art to illustrate the
data.
Also - the above is a contrived example, but it relates to a
real-world
example im trying to solve.

Any help would be greatly appreciated. I suspect its something along
the lines of using SUMIF, COUNTIF, V/HLOOKUP, etc. Ive come close, but
im kinda stuck on a few parts (namely once i've matches the number the
person entered in column E, i need to do a COUNTIF( on that same ROW -
but i dont know how to find out that row).

Thanks!



  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 16
Default Counting Help

Much thanks Roger - I will try that tommorow at work.

Roger Govier wrote:
Hi

try
=COUNTIF(OFFSET($E$1,MATCH(A1,$E$1:$E$2)-1,1,1,3),"x")

Amend ranges to suit

--
Regards

Roger Govier


wrote in message
ps.com...
Hopefully someone can help me with this.

I have the following source data, 2 rows and 2 columns.:

A B
1 2 ?
2 1 ?

In column A I would enter a number.
Column B would be a forumla that returns a result, given the data
below.

Then I have the data I want to lookup in, 2 rows and 4 columns (in
this
example)

E F G H
1 1 X X
2 2 X

Column E would be a unique number, generated via =ROW()
Column F,G,H would have "X"'s in the column (ie if it was checked off)

Now given that above.
If someone entered a "2" in Column A, Row 1 above, I want a formula
that will search through E1..E2, and if it matches what was entered
(2), then it go through that same row (2) (in this case F2..H2) and
counts all the X's - in this case it would return 1.
If someone entered a "1" A2, it would return "2", since it found "1"
in
E1, and thus searched F1..H1 for "X"'s and found 2 of them.

Hopefully that above shows up ok with ugly ascii art to illustrate the
data.
Also - the above is a contrived example, but it relates to a
real-world
example im trying to solve.

Any help would be greatly appreciated. I suspect its something along
the lines of using SUMIF, COUNTIF, V/HLOOKUP, etc. Ive come close, but
im kinda stuck on a few parts (namely once i've matches the number the
person entered in column E, i need to do a COUNTIF( on that same ROW -
but i dont know how to find out that row).

Thanks!


  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 16
Default Counting Help

That worked Roger - much thanks! Very Appreciated!



  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 16
Default Counting Help


Actually, this example _dosent_ seem to work if the data isnt in order
(which it isnt)
For example, if the lookup data is formatted like so:

E F G H
1 2 X X
2 1 X
3 3 X

The given formula gives an error.

Any suggestions?

  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,886
Default Counting Help

Hi

The try this modification
=COUNTIF(OFFSET($E$1,MATCH(A1,$E$1:$E$3,0)-1,1,1,3),"x")

--
Regards

Roger Govier


wrote in message
oups.com...

Actually, this example _dosent_ seem to work if the data isnt in order
(which it isnt)
For example, if the lookup data is formatted like so:

E F G H
1 2 X X
2 1 X
3 3 X

The given formula gives an error.

Any suggestions?



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
counting days? Richard Excel Discussion (Misc queries) 2 August 1st 06 02:37 PM
conditional counting with Excel LeicaElmar Excel Worksheet Functions 1 October 17th 05 10:23 PM
Counting rows, then counting values. Michael via OfficeKB.com Excel Discussion (Misc queries) 7 August 4th 05 10:57 PM
Counting names in a column but counting duplicate names once TBoe Excel Discussion (Misc queries) 9 May 11th 05 11:24 PM
Counting... Patrick G Excel Worksheet Functions 3 February 23rd 05 10:05 PM


All times are GMT +1. The time now is 05:12 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"