#1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 8
Default If Statement

I have a column of numbers that range from 1 - 10 and I need to write a
formula that says if B1:B5 = 5 then I need to divide the number of cells
that are = 5 by the total number of customers in the column.



  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,574
Default If Statement

If I understand you correctly this should do it:
=IF(SUM($B$1:$B$5=10,IF(B1=5,B1/COUNT($B$1:$B$5),""))


Dave
--
Brevity is the soul of wit.


"Carter68" wrote:

I have a column of numbers that range from 1 - 10 and I need to write a
formula that says if B1:B5 = 5 then I need to divide the number of cells
that are = 5 by the total number of customers in the column.



  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 8
Default If Statement

Sorry, that didn't work. Let me be more specific. I need to know how many of
the numbers in this column are = 5 and then I need to divide the number that
are = 5 by the total number of customers. In this case 3 are = to 5, so I
need to divide 3 by 5 which equals 60%.

John 5
Sue 2
Sally 6
George 1
Joe 10
60% Cross Sale Ratio

"Dave F" wrote:

If I understand you correctly this should do it:
=IF(SUM($B$1:$B$5=10,IF(B1=5,B1/COUNT($B$1:$B$5),""))


Dave
--
Brevity is the soul of wit.


"Carter68" wrote:

I have a column of numbers that range from 1 - 10 and I need to write a
formula that says if B1:B5 = 5 then I need to divide the number of cells
that are = 5 by the total number of customers in the column.



  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 740
Default If Statement

from specifis example maybe something like this will work

=COUNTIF(B1:B5,"=5")/COUNTA(A1:A5)

or
=TEXT(COUNTIF(B1:B5,"=5")/COUNTA(A1:A5),"0.00%") & " [cross sale percentage]"

--
*****
birds of the same feather flock together..



"Carter68" wrote:

Sorry, that didn't work. Let me be more specific. I need to know how many of
the numbers in this column are = 5 and then I need to divide the number that
are = 5 by the total number of customers. In this case 3 are = to 5, so I
need to divide 3 by 5 which equals 60%.

John 5
Sue 2
Sally 6
George 1
Joe 10
60% Cross Sale Ratio

"Dave F" wrote:

If I understand you correctly this should do it:
=IF(SUM($B$1:$B$5=10,IF(B1=5,B1/COUNT($B$1:$B$5),""))


Dave
--
Brevity is the soul of wit.


"Carter68" wrote:

I have a column of numbers that range from 1 - 10 and I need to write a
formula that says if B1:B5 = 5 then I need to divide the number of cells
that are = 5 by the total number of customers in the column.



  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 620
Default If Statement

=COUNTIF(B1:B5,"=5")/COUNT(B1:B5)
--
David Biddulph

"Carter68" wrote in message
...
Sorry, that didn't work. Let me be more specific. I need to know how many
of
the numbers in this column are = 5 and then I need to divide the number
that
are = 5 by the total number of customers. In this case 3 are = to 5, so
I
need to divide 3 by 5 which equals 60%.

John 5
Sue 2
Sally 6
George 1
Joe 10
60% Cross Sale Ratio

"Dave F" wrote:

If I understand you correctly this should do it:
=IF(SUM($B$1:$B$5=10,IF(B1=5,B1/COUNT($B$1:$B$5),""))


Dave
--
Brevity is the soul of wit.


"Carter68" wrote:

I have a column of numbers that range from 1 - 10 and I need to write a
formula that says if B1:B5 = 5 then I need to divide the number of
cells
that are = 5 by the total number of customers in the column.





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
Question using dates in a statement Wink20TCU Excel Discussion (Misc queries) 2 January 3rd 07 03:33 PM
SQL concatenation statement CLamar Excel Discussion (Misc queries) 0 June 29th 06 01:58 PM
SET statement tutorial Daminc Excel Discussion (Misc queries) 13 January 17th 06 04:47 PM
If statement Matt Montagliano Excel Discussion (Misc queries) 1 September 8th 05 08:47 PM
Do I need a sumif or sum of a vlookup formula? PeterB Excel Worksheet Functions 0 June 1st 05 12:23 PM


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