Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 4
Default if conditions in 2 cell correct then display third cell

Hi all,
Sorry about the long subject.
I am trying to streamline a tracking spreadsheet that I created for our
school. Here's the problem.
A B C D
Child's name sex set data
Tom M T 1
Dick M B 2
Harry M T 2
Sue F T 1
Jane F B 2
and so on.
I want to check how a particular set of children are doing. So I want to be
able for example check the average score for all of the girls(F) in the
top(T) set, or the boys(M) in the bottom(B) set.
I solved the problem originally by in column E having this formula
=IF(AND(B2="F",C2="T")=TRUE,D2,"") which worked well once copied down, I
could then average the data, which is the final result I want. What I would
like to know is, can I do this all in one formula, check column B when
column C and when give an average? I have tried the following
{=AVERAGE(IF(AND(sex="F",set="T")=TRUE,y2m,""))} where column B is named
"sex" and column c is named "set" and column D is "y2m". It doesn't work and
I don't seem to be able to ask the help the right question. So you're my
only hope. If I can't solve it neatly then the old way will suffice. But my
sanity might suffer as I will keep thinking of a way to do it
Yours Paul


  #2   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 1,533
Default if conditions in 2 cell correct then display third cell

Hi Paul

With the sex and set which you want to calculate average for in F2:G2, the
average can be calculated in H2 with this formula (in one line):

=SUMPRODUCT(--($B$2:$B$100=F2),--($C$2:$C$100=G2),--($D$2:$D$100))/SUMPRODUCT(--($B$2:$B$100=F2),--($C$2:$C$100=G2))

The formula can be copied down to set up an average table.

Hopes this help.

---
Per

"Paul Hood" skrev i meddelelsen
...
Hi all,
Sorry about the long subject.
I am trying to streamline a tracking spreadsheet that I created for our
school. Here's the problem.
A B C D
Child's name sex set data
Tom M T 1
Dick M B 2
Harry M T 2
Sue F T 1
Jane F B 2
and so on.
I want to check how a particular set of children are doing. So I want to
be able for example check the average score for all of the girls(F) in the
top(T) set, or the boys(M) in the bottom(B) set.
I solved the problem originally by in column E having this formula
=IF(AND(B2="F",C2="T")=TRUE,D2,"") which worked well once copied down, I
could then average the data, which is the final result I want. What I
would like to know is, can I do this all in one formula, check column B
when column C and when give an average? I have tried the following
{=AVERAGE(IF(AND(sex="F",set="T")=TRUE,y2m,""))} where column B is named
"sex" and column c is named "set" and column D is "y2m". It doesn't work
and I don't seem to be able to ask the help the right question. So you're
my only hope. If I can't solve it neatly then the old way will suffice.
But my sanity might suffer as I will keep thinking of a way to do it
Yours Paul


  #3   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 4
Default if conditions in 2 cell correct then display third cell

Dear Per
Thanks that works wonderfully, as long as the data column has a value in it.
I can adjust the range manually but (and I'm pushing it here :)) is there
any way it can cope with a blank cell (all of the cell have a formula in
them to generate the data)?
If not what you have done is brilliant and I can use it.
Thanks Paul
"Per Jessen" wrote in message
...
Hi Paul

With the sex and set which you want to calculate average for in F2:G2, the
average can be calculated in H2 with this formula (in one line):

=SUMPRODUCT(--($B$2:$B$100=F2),--($C$2:$C$100=G2),--($D$2:$D$100))/SUMPRODUCT(--($B$2:$B$100=F2),--($C$2:$C$100=G2))

The formula can be copied down to set up an average table.

Hopes this help.

---
Per

"Paul Hood" skrev i meddelelsen
...
Hi all,
Sorry about the long subject.
I am trying to streamline a tracking spreadsheet that I created for our
school. Here's the problem.
A B C D
Child's name sex set data
Tom M T 1
Dick M B 2
Harry M T 2
Sue F T 1
Jane F B 2
and so on.
I want to check how a particular set of children are doing. So I want to
be able for example check the average score for all of the girls(F) in
the top(T) set, or the boys(M) in the bottom(B) set.
I solved the problem originally by in column E having this formula
=IF(AND(B2="F",C2="T")=TRUE,D2,"") which worked well once copied down,
I could then average the data, which is the final result I want. What I
would like to know is, can I do this all in one formula, check column B
when column C and when give an average? I have tried the following
{=AVERAGE(IF(AND(sex="F",set="T")=TRUE,y2m,""))} where column B is named
"sex" and column c is named "set" and column D is "y2m". It doesn't work
and I don't seem to be able to ask the help the right question. So you're
my only hope. If I can't solve it neatly then the old way will suffice.
But my sanity might suffer as I will keep thinking of a way to do it
Yours Paul




  #4   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 1,533
Default if conditions in 2 cell correct then display third cell

Hi Paul

Thanks for your reply.

With this little modification, the divisor will only count non blank data
cells meeting previous conditons.

=SUMPRODUCT(--($B$2:$B$100=F2),--($C$2:$C$100=G2),--($D$2:$D$100))/SUMPRODUCT(--($B$2:$B$100=F2),--($C$2:$C$100=G2),--($D2:$D100<""))

Regards,
Per

"Paul Hood" skrev i meddelelsen
...
Dear Per
Thanks that works wonderfully, as long as the data column has a value in
it. I can adjust the range manually but (and I'm pushing it here :)) is
there any way it can cope with a blank cell (all of the cell have a
formula in them to generate the data)?
If not what you have done is brilliant and I can use it.
Thanks Paul
"Per Jessen" wrote in message
...
Hi Paul

With the sex and set which you want to calculate average for in F2:G2,
the average can be calculated in H2 with this formula (in one line):

=SUMPRODUCT(--($B$2:$B$100=F2),--($C$2:$C$100=G2),--($D$2:$D$100))/SUMPRODUCT(--($B$2:$B$100=F2),--($C$2:$C$100=G2))

The formula can be copied down to set up an average table.

Hopes this help.

---
Per

"Paul Hood" skrev i meddelelsen
...
Hi all,
Sorry about the long subject.
I am trying to streamline a tracking spreadsheet that I created for our
school. Here's the problem.
A B C D
Child's name sex set data
Tom M T 1
Dick M B 2
Harry M T 2
Sue F T 1
Jane F B 2
and so on.
I want to check how a particular set of children are doing. So I want to
be able for example check the average score for all of the girls(F) in
the top(T) set, or the boys(M) in the bottom(B) set.
I solved the problem originally by in column E having this formula
=IF(AND(B2="F",C2="T")=TRUE,D2,"") which worked well once copied down,
I could then average the data, which is the final result I want. What I
would like to know is, can I do this all in one formula, check column B
when column C and when give an average? I have tried the following
{=AVERAGE(IF(AND(sex="F",set="T")=TRUE,y2m,""))} where column B is named
"sex" and column c is named "set" and column D is "y2m". It doesn't work
and I don't seem to be able to ask the help the right question. So
you're my only hope. If I can't solve it neatly then the old way will
suffice. But my sanity might suffer as I will keep thinking of a way to
do it
Yours Paul





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
Countif Conditions - Use of conditions that vary by cell value JonTarg Excel Discussion (Misc queries) 1 May 30th 08 01:21 PM
Conditional formatting Based on cell A text with conditions in Cell B Raicomm Excel Discussion (Misc queries) 0 January 21st 08 04:46 PM
vlookup is returning a value one cell above the correct cell. dbaker4 Excel Worksheet Functions 4 April 20th 06 08:21 PM
formatting a cell to display the correct date. Lee Excel Discussion (Misc queries) 1 February 23rd 06 04:04 PM
How can I blank a cell until a ref cell has the correct data? force530 Excel Discussion (Misc queries) 1 May 19th 05 09:06 PM


All times are GMT +1. The time now is 08:27 AM.

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"