#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 61
Default Find/Repalce

I have a file in which cells have text followed by numbers...the ending
numbers are always 4 digits....anytime the number is greater than 2550, I
want to replace it with 2550, is there a way to generate a formula or a macro
that can do that but not mess with the text before it in the cell?

Thanks!
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 61
Default Find/Repalce

The number will always have a "Z-" before it, so that may be able to be an
indicator...however if it is "X-" OR "Y-" I do not want the number changed.

"lightbulb" wrote:

I have a file in which cells have text followed by numbers...the ending
numbers are always 4 digits....anytime the number is greater than 2550, I
want to replace it with 2550, is there a way to generate a formula or a macro
that can do that but not mess with the text before it in the cell?

Thanks!

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8,520
Default Find/Repalce

With your data in cell A1; try the below formula

=IF(ISERROR(SEARCH("Z-",A1)),A1,LEFT(A1,SEARCH("Z-",A1)+1) &
MIN(2550,MID(A1,SEARCH("Z-",A1)+2,5)))
(all in one line)

If this post helps click Yes
---------------
Jacob Skaria


"lightbulb" wrote:

The number will always have a "Z-" before it, so that may be able to be an
indicator...however if it is "X-" OR "Y-" I do not want the number changed.

"lightbulb" wrote:

I have a file in which cells have text followed by numbers...the ending
numbers are always 4 digits....anytime the number is greater than 2550, I
want to replace it with 2550, is there a way to generate a formula or a macro
that can do that but not mess with the text before it in the cell?

Thanks!

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
How to get cursor to start with "Find What i/o "Repalce With"? eatong Excel Discussion (Misc queries) 1 May 28th 09 04:07 PM
Find First Non blank cell than find column header and return that value Silver Rose Excel Worksheet Functions 10 April 30th 07 05:56 PM
Despite data existing in Excel 2002 spreadsheet Find doesn't find AnnieB Excel Discussion (Misc queries) 1 June 16th 06 02:15 AM
hoe can I repalce a formula with its result automatically AldreteMeza Excel Discussion (Misc queries) 1 March 22nd 06 07:55 PM
How to repalce numbers after a decimal dpscoupe Excel Discussion (Misc queries) 4 December 15th 05 05:51 PM


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