Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 5
Default Is there anything like the Access "LIKE" function in Excel?

I would like to identify only the values in a spreadsheet with "CU" included
in them. That "CU" could be at the beginning, end or middle of the values in
the column. In access I could use the LIKE feature. Is there anything
similar in Excel to identify them?

Thank you!
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 5,939
Default Is there anything like the Access "LIKE" function in Excel?

Identify is a little vague. Are you trying to aggregate based on finding CU
in a field. If so then check out this link...

http://www.xldynamic.com/source/xld.SUMPRODUCT.html
Check out example 9 at the bottom.

If you just want to know if a cell is contains CU then you can use Find or
Search. Look them up in help.
--
HTH...

Jim Thomlinson


"pa1971" wrote:

I would like to identify only the values in a spreadsheet with "CU" included
in them. That "CU" could be at the beginning, end or middle of the values in
the column. In access I could use the LIKE feature. Is there anything
similar in Excel to identify them?

Thank you!

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3,290
Default Is there anything like the Access "LIKE" function in Excel?



The "Like" operator is available only when using VBA code in Excel.
--
Jim Cone
San Francisco, USA
http://www.realezsites.com/bus/primitivesoftware
(Excel Add-ins / Excel Programming)



"pa1971"
wrote in message
I would like to identify only the values in a spreadsheet with "CU" included
in them. That "CU" could be at the beginning, end or middle of the values in
the column. In access I could use the LIKE feature. Is there anything
similar in Excel to identify them?

Thank you!
  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3,365
Default Is there anything like the Access "LIKE" function in Excel?

Here's some code that expands on Jim's comment that you could use to identify
the cells. Presumes that you aren't shading any cells red for other reasons.
When it finds a cell with cu, Cu, CU or cU in it anywhere, it'll shade the
cell bright red.

The clear shading routine clears all cells of their shading - so it
will/would wipe out any other shading you have applied to other cells.

Both routines can be 'tweaked' to give more desirable results.

Sub FindCU_Entries()
Dim anyCell As Range

For Each anyCell In ActiveSheet.UsedRange
If UCase(anyCell.Text) Like "*CU*" Then
anyCell.Interior.ColorIndex = 3
End If
Next
End Sub

Sub ClearColorIndex()
'resets ALL sheet cell shading to none/white
ActiveSheet.UsedRange.Interior.ColorIndex = xlNone
End Sub


"Jim Cone" wrote:



The "Like" operator is available only when using VBA code in Excel.
--
Jim Cone
San Francisco, USA
http://www.realezsites.com/bus/primitivesoftware
(Excel Add-ins / Excel Programming)



"pa1971"
wrote in message
I would like to identify only the values in a spreadsheet with "CU" included
in them. That "CU" could be at the beginning, end or middle of the values in
the column. In access I could use the LIKE feature. Is there anything
similar in Excel to identify them?

Thank you!

  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1,231
Default Is there anything like the Access "LIKE" function in Excel?

pa1971 wrote...
I would like to identify only the values in a spreadsheet with "CU"
included in them. That "CU" could be at the beginning, end or middle
of the values in the column. In access I could use the LIKE feature.
Is there anything similar in Excel to identify them?


Count them? Use

=COUNTIF(YourRangeAddressHere,"*CU*")

Find the index of the first one in a 1D range? Use

=MATCH("*CU*",YourRangeAddressHere,0)

Find the index of the n_th (n 1) one in a 1D range? Use the array
formula

=SMALL(IF(ISNUMBER(SEARCH("*CU*",YourRangeAddressH ere)),
ROW(YourRangeAddressHere)-MIN(ROW(YourRangeAddressHere))+1),n)
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
Text "comparison" operator for "contains" used in an "IF" Function Pawaso Excel Worksheet Functions 4 April 4th 23 11:35 AM
change "true" and "false" to "availble" and "out of stock" inthestands Excel Worksheet Functions 2 July 19th 07 07:05 PM
HELP on "left","right","find","len","substitute" functions serene83 Excel Discussion (Misc queries) 5 June 27th 06 02:23 AM
Count occurences of "1"/"0" (or"TRUE"/"FALSE") in a row w. conditions in the next BCB New Users to Excel 7 May 13th 06 10:02 PM
inserting a conditional "go to" command on a excel "if" function velasques Excel Worksheet Functions 5 March 10th 06 08:16 PM


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