Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 31
Default Excel function - countif

I am using the countif function to count all of the cells in a column (B1-B5)
that have the value "x."

=COUNTIF('Remote Offices'!B1:B5,"x")

I want to modify the formula, so that it returns to me the text in a
different column (A1-A5) if the condition is met. Is this possible?

For example if cells B1, B2, and B5 have the value "x" and cells
A1="Irvine", A2="Anaheim, and A5="Tustin", I would like the function to give
the following result:
"Irvine, Anaheim, Tustin"

  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 8,856
Default Excel function - countif

Well, you could have a construct like this:

=IF('Remote Offices'!B1="x",'Remote Offices'!A1&", ","") & IF('Remote
Offices'!B2="x",'Remote Offices'!A2&", ","") & IF('Remote Offices'!
B3="x",'Remote Offices'!A3&", ","") & IF('Remote Offices'!
B4="x",'Remote Offices'!A4&", ","") & IF('Remote Offices'!
B5="x",'Remote Offices'!A5&", ","")

and you could continue in this way for several cells, but it is not
very elegant.

Hope this helps.

Pete

On Dec 8, 11:41*pm, Sanjay wrote:
I am using the countif function to count all of the cells in a column (B1-B5)
that have the value "x." *

=COUNTIF('Remote Offices'!B1:B5,"x")

I want to modify the formula, so that it returns to me the text in a
different column (A1-A5) if the condition is met. Is this possible?

For example if cells B1, B2, and B5 have the value "x" and cells
A1="Irvine", A2="Anaheim, and A5="Tustin", I would like the function to give
the following result:
"Irvine, Anaheim, Tustin"


  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 96
Default Excel function - countif

That's called string concatenation and it's not a native function to Excel.
But you can add it if you're OK with enabling VBA in your worksheet.

http://www.excelforum.com/excel-prog...in-cell.html#2

That link to another forum included a copy of a UDF you can install in your
worksheet called CONCATIF(). It's used like a SUMIF() with a couple of extra
parameters. After you install the UDF, the formula for you would be:

=CONCATIF(B1:B5, "x", A1:A5, ",", TRUE)

--
"Actually, I *am* a rocket scientist." -- JB
(www.MadRocketScientist.com)

Your feedback is appreciated, click YES if this post helped you.


"Sanjay" wrote:

I am using the countif function to count all of the cells in a column (B1-B5)
that have the value "x."

=COUNTIF('Remote Offices'!B1:B5,"x")

I want to modify the formula, so that it returns to me the text in a
different column (A1-A5) if the condition is met. Is this possible?

For example if cells B1, B2, and B5 have the value "x" and cells
A1="Irvine", A2="Anaheim, and A5="Tustin", I would like the function to give
the following result:
"Irvine, Anaheim, Tustin"

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 function excel 2007 Dave H[_2_] Excel Worksheet Functions 1 May 14th 08 06:06 PM
Excel - COUNTIF Function jsk New Users to Excel 2 November 7th 06 01:26 AM
Excel COUNTIF function Viks Excel Worksheet Functions 4 January 3rd 06 01:18 PM
Excel function countif??? Raj7 Excel Worksheet Functions 3 May 26th 05 11:34 PM
Excel countif function bkcthecat Excel Worksheet Functions 2 March 13th 05 04:57 PM


All times are GMT +1. The time now is 01:13 PM.

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"