Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
aruba64taw
 
Posts: n/a
Default Excell-How to add the number of cells containing text? = a sum

For a wedding. I have the different meals in seperate columns. I need to add
the number of Beef dinners and the number of Chicken dinners. I cannot use a
number conveniently for the "Beef" or the "Chicken". I tried
=IF(G95="Beef","1","0") with the conditional number "1" going into a side
work column and then summed that work column. But apparently the "1" in the
conditional statement is not a 'number' 1. As soon as I substituted a number
1 for the conditional 1, the sum worked.
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Biff
 
Posts: n/a
Default Excell-How to add the number of cells containing text? = a sum

Hi!

=IF(G95="Beef","1","0")


That formula is returning TEXT and not the numeric numbers you think it is.
That's why when you tried a sum of that column it didn't work.

It should be written like this:

=IF(G95="Beef",1,0)

Another way to do what you want and not use a whole column IF formulas:

A1 = Beef
A2 = Chicken

B1 = formula:

=COUNTIF(G$1:G$100,A1)

Copy down into cell B2.

Biff

"aruba64taw" wrote in message
...
For a wedding. I have the different meals in seperate columns. I need to
add
the number of Beef dinners and the number of Chicken dinners. I cannot use
a
number conveniently for the "Beef" or the "Chicken". I tried
=IF(G95="Beef","1","0") with the conditional number "1" going into a side
work column and then summed that work column. But apparently the "1" in
the
conditional statement is not a 'number' 1. As soon as I substituted a
number
1 for the conditional 1, the sum worked.



  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Bob Phillips
 
Posts: n/a
Default Excell-How to add the number of cells containing text? = a sum

Notwithstanding Biff's answer, you should have used numbers in the formula

=IF(G95="Beef",1,0)

--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)

"aruba64taw" wrote in message
...
For a wedding. I have the different meals in seperate columns. I need to

add
the number of Beef dinners and the number of Chicken dinners. I cannot use

a
number conveniently for the "Beef" or the "Chicken". I tried
=IF(G95="Beef","1","0") with the conditional number "1" going into a side
work column and then summed that work column. But apparently the "1" in

the
conditional statement is not a 'number' 1. As soon as I substituted a

number
1 for the conditional 1, the sum worked.



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
Formulas dealing with text data Bagia Excel Worksheet Functions 6 June 20th 05 10:29 PM
Sort or Filter option? Mcobra41 Excel Worksheet Functions 3 February 23rd 05 07:22 PM
Convert data of cells to any type: Number, Date&Time, Text Kevin Excel Discussion (Misc queries) 0 December 30th 04 06:55 AM
Formatting a cell as "text" in the number catagory. Ed Excel Worksheet Functions 3 December 7th 04 07:12 PM
GET.CELL Biff Excel Worksheet Functions 2 November 24th 04 07:16 PM


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