Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 661
Default If function?

Newbie question...I'm looking for the formula that will report the value that
I want in column B. I guess wildcards must nbe used. I tried =IF (A1 =
"*Catalog*", "Catalog", IF(A1 = "*Stock*", "Stock"))

A B
Stock - Rock Stock
Catalog - Indie Catalog
Catalog - Rock Catalog
Stock - Indie Stock

Thanks for your help.

Paul

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default If function?

Try

=IF(COUNTIF(A1,"*stock*"),"stock","no stock")


"Paul" wrote in message
...
Newbie question...I'm looking for the formula that will report
the value that
I want in column B. I guess wildcards must nbe used. I tried
=IF (A1 =
"*Catalog*", "Catalog", IF(A1 = "*Stock*", "Stock"))

A B
Stock - Rock Stock
Catalog - Indie Catalog
Catalog - Rock Catalog
Stock - Indie Stock

Thanks for your help.

Paul



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default If function?

=if(countif(A1,"*Catalog*"),"Catalog",if(countif(A 1,"*Stock*"),"Stock","not
found"))

--
Regards,
Tom Ogilvy


"Paul" wrote in message
...
Newbie question...I'm looking for the formula that will report the value

that
I want in column B. I guess wildcards must nbe used. I tried =IF (A1 =
"*Catalog*", "Catalog", IF(A1 = "*Stock*", "Stock"))

A B
Stock - Rock Stock
Catalog - Indie Catalog
Catalog - Rock Catalog
Stock - Indie Stock

Thanks for your help.

Paul



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 661
Default If function?

Thanks chips, but what happens with my other variable?

"Chip Pearson" wrote:

Try

=IF(COUNTIF(A1,"*stock*"),"stock","no stock")


"Paul" wrote in message
...
Newbie question...I'm looking for the formula that will report
the value that
I want in column B. I guess wildcards must nbe used. I tried
=IF (A1 =
"*Catalog*", "Catalog", IF(A1 = "*Stock*", "Stock"))

A B
Stock - Rock Stock
Catalog - Indie Catalog
Catalog - Rock Catalog
Stock - Indie Stock

Thanks for your help.

Paul




  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default If function?

If you want to extract the leftmost part, before the dash, you might
try these two functions.

in B1:
=SEARCH(" - ", A1)

That puts a 6 in B1, which is the position of the dash.

in C1:
=LEFT(A1, B1)

That puts "Stock" in C1, which is the leftmost portion of A1 until the
dash.

(When you're happy with the first line, you should copy these to the
second and subsequent lines with the Fill Down command.)

You may also combine these into one nested function:
=LEFT(A1, SEARCH(" - ", A1))

The way you can find these nifty functions is clicking on the "fx"
probably above the "B" column header. You can enter a description of
what you're looking for or just pick the Text category.



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default If function?

=IF(COUNTIF(A1,"*stock*"),"stock",IF("COUNTIF(A1," *catalog*"),"Catalog","Nei
ther"))


--

HTH

Bob Phillips

(remove nothere from the email address if mailing direct)

"Paul" wrote in message
...
Thanks chips, but what happens with my other variable?

"Chip Pearson" wrote:

Try

=IF(COUNTIF(A1,"*stock*"),"stock","no stock")


"Paul" wrote in message
...
Newbie question...I'm looking for the formula that will report
the value that
I want in column B. I guess wildcards must nbe used. I tried
=IF (A1 =
"*Catalog*", "Catalog", IF(A1 = "*Stock*", "Stock"))

A B
Stock - Rock Stock
Catalog - Indie Catalog
Catalog - Rock Catalog
Stock - Indie Stock

Thanks for your help.

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
Excel Data Validation/Lookup function does function correcty Kirkey Excel Worksheet Functions 2 May 25th 09 09:22 PM
LINKEDRANGE function - a complement to the PULL function (for getting values from a closed workbook) [email protected] Excel Worksheet Functions 0 September 5th 06 03:44 PM
Emulate Index/Match combo function w/ VBA custom function Spencer Hutton Excel Worksheet Functions 2 May 2nd 05 05:26 PM
Adding a custom function to the default excel function list DonutDel Excel Programming 3 November 21st 03 03:41 PM
User-Defined Function pre-empting Built-in Function? How to undo???? MarWun Excel Programming 1 August 6th 03 09:31 PM


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