LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #29   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Ron Rosenfeld
 
Posts: n/a
Default extracting numbers

On Wed, 8 Feb 2006 11:26:40 -0800, "cj" wrote:

ron

this formula =MID(A1,FIND("cash",A1)-1,1)+MID(A1,FIND("office",A1)-1,1)
works fine if i enter in a1 : 3cash 2office 1train or 3cash 2office,but
returns with #value! error when i enter just 8cash or left blank for that day
off. with the regex formula i can enter "-" for the blank day and my totals
on the bottom still works and i can change and add combination of the words
cash|cs|office|of and i can add extra words after them "3cash training
2office(front).


I see what you mean. And I'm glad you've got something working for yourself.

To return a zero when the descriptor does not exist, you could also use a
formula like:

=REGEX.MID(A1&"0","\d(?=descriptor|$)")

or, for cash:

=REGEX.MID(A1&"0","\d(?=cash|$)")

or, to allow for the possibility of a <space between the number and the
descriptor:

=REGEX.MID(A1&"0","\d(?=\s*(descriptor|$))")





--ron
 
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
Help! How do you get excel to find the x(changes daily, marked in a cell from another formula) highest numbers in a group of numbers and sum them up? C-Man23 Excel Worksheet Functions 1 January 9th 06 01:23 PM
Checking Winning Numbers in the Lottery. Ann Excel Discussion (Misc queries) 4 May 18th 05 10:55 AM
Sorting alphanumeric numbers maurice.centner Excel Discussion (Misc queries) 2 May 6th 05 02:00 AM
Converting Numbers to Text properly Shirley Munro Excel Discussion (Misc queries) 1 February 16th 05 03:01 PM
Sorting when some numbers have a text suffix confused on the tundra Excel Discussion (Misc queries) 5 December 18th 04 10:19 PM


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