#1   Report Post  
LostNFound
 
Posts: n/a
Default If or Lookup

I have a spreadsheet with numbers from 1-20 in column A and a formula that
returns either a yes or 0(blank) in column D. I am trying to set a formula
that would look down A and if it contains a 1 give me the total number of
ones and then the total number of ones with "yes" only then give me the
percentage of 1's with no "yes" Because Yes means you were late and I need to
know the percentage of on time. I need to do this with the 2's in column A
and the 3's in column A and so on until I get to 6's then it will be 6 and
up...
Any help or advice would be greatly appreciated.
  #2   Report Post  
Bob Phillips
 
Posts: n/a
Default

=SUMPRODUCT(--(A1:A100=1),--(D1:D100="yes"))/COUNTIF(A1:A100,1)

will give the percentage

--

HTH

RP
(remove nothere from the email address if mailing direct)


"LostNFound" wrote in message
...
I have a spreadsheet with numbers from 1-20 in column A and a formula

that
returns either a yes or 0(blank) in column D. I am trying to set a formula
that would look down A and if it contains a 1 give me the total number of
ones and then the total number of ones with "yes" only then give me the
percentage of 1's with no "yes" Because Yes means you were late and I need

to
know the percentage of on time. I need to do this with the 2's in column

A
and the 3's in column A and so on until I get to 6's then it will be 6 and
up...
Any help or advice would be greatly appreciated.



  #3   Report Post  
LostNFound
 
Posts: n/a
Default

Is this counting the "yes" only with "1" in column A! Is it looking for both
criterias?
I had eight ones in column A and one yes were there was a one and it
returned 12.5% it should have returned 88%

What did I do wrong??

"Bob Phillips" wrote:

=SUMPRODUCT(--(A1:A100=1),--(D1:D100="yes"))/COUNTIF(A1:A100,1)

will give the percentage

--

HTH

RP
(remove nothere from the email address if mailing direct)


"LostNFound" wrote in message
...
I have a spreadsheet with numbers from 1-20 in column A and a formula

that
returns either a yes or 0(blank) in column D. I am trying to set a formula
that would look down A and if it contains a 1 give me the total number of
ones and then the total number of ones with "yes" only then give me the
percentage of 1's with no "yes" Because Yes means you were late and I need

to
know the percentage of on time. I need to do this with the 2's in column

A
and the 3's in column A and so on until I get to 6's then it will be 6 and
up...
Any help or advice would be greatly appreciated.




  #4   Report Post  
Aladin Akyurek
 
Posts: n/a
Default

LostNFound wrote:
Is this counting the "yes" only with "1" in column A! Is it looking for both
criterias?
I had eight ones in column A and one yes were there was a one and it
returned 12.5% it should have returned 88%

What did I do wrong??

"Bob Phillips" wrote:


=SUMPRODUCT(--(A1:A100=1),--(D1:D100="yes"))/COUNTIF(A1:A100,1)

will give the percentage


Replace the "yes" bit with just "".
  #5   Report Post  
Gary Brown
 
Posts: n/a
Default

In F1 throught F20 put the #s 1 through 20.
In G1, put the following formula AS AN ARRAY.
=SUM((A1:A8=F1)*(D1:D8="Yes")*1)
what should appear in the cell is...
{=SUM((A1:A8=F1)*(D1:D8="Yes")*1)}
To make an array, while creating or editing the formula, hit
'Ctrl-Shift-Enter'. { and } brackets will surround the formula if you did it
right (NOTE: you can NOT simply put the brackets in.)
Copy this formula from G1 to G20.
This is the count of 'yes' responses to the number in column F
In H1, put...
=COUNTIF(A1:A8,F1)
This is the count of the number in column F
In I1, put...
=G1/H1
This is the percentage of 'yes' for the number in column F
In J1, put...
=1-I1
This is the percentage of 'no' for the number in column F
Copy the formulas in H, I and J down to row 20.

HTH,
Gary Brown





"LostNFound" wrote:

I have a spreadsheet with numbers from 1-20 in column A and a formula that
returns either a yes or 0(blank) in column D. I am trying to set a formula
that would look down A and if it contains a 1 give me the total number of
ones and then the total number of ones with "yes" only then give me the
percentage of 1's with no "yes" Because Yes means you were late and I need to
know the percentage of on time. I need to do this with the 2's in column A
and the 3's in column A and so on until I get to 6's then it will be 6 and
up...
Any help or advice would be greatly appreciated.



  #6   Report Post  
Gary Brown
 
Posts: n/a
Default

Remember to correct for the ranges. In other words, the below example has
data from row 1 to row 8, but your data may be from row 2 to row 2500.
HTH,
Gary Brown


"Gary Brown" wrote:

In F1 throught F20 put the #s 1 through 20.
In G1, put the following formula AS AN ARRAY.
=SUM((A1:A8=F1)*(D1:D8="Yes")*1)
what should appear in the cell is...
{=SUM((A1:A8=F1)*(D1:D8="Yes")*1)}
To make an array, while creating or editing the formula, hit
'Ctrl-Shift-Enter'. { and } brackets will surround the formula if you did it
right (NOTE: you can NOT simply put the brackets in.)
Copy this formula from G1 to G20.
This is the count of 'yes' responses to the number in column F
In H1, put...
=COUNTIF(A1:A8,F1)
This is the count of the number in column F
In I1, put...
=G1/H1
This is the percentage of 'yes' for the number in column F
In J1, put...
=1-I1
This is the percentage of 'no' for the number in column F
Copy the formulas in H, I and J down to row 20.

HTH,
Gary Brown





"LostNFound" wrote:

I have a spreadsheet with numbers from 1-20 in column A and a formula that
returns either a yes or 0(blank) in column D. I am trying to set a formula
that would look down A and if it contains a 1 give me the total number of
ones and then the total number of ones with "yes" only then give me the
percentage of 1's with no "yes" Because Yes means you were late and I need to
know the percentage of on time. I need to do this with the 2's in column A
and the 3's in column A and so on until I get to 6's then it will be 6 and
up...
Any help or advice would be greatly appreciated.

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
Lookup Lookup Lookup MR Excel Worksheet Functions 2 March 10th 05 01:59 AM
Lookup Function Problem seve Excel Discussion (Misc queries) 9 February 28th 05 02:46 AM
Lookup function w/Text and Year Josh O. Excel Worksheet Functions 1 February 12th 05 11:27 PM
Excel Lookup Functions Paul Adams Excel Worksheet Functions 1 November 10th 04 02:40 PM
double lookup, nest, or macro? Josef.angel Excel Worksheet Functions 1 October 29th 04 09:50 AM


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