<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Office-it.orG &#187; MS Office</title>
	<atom:link href="http://www.office-it.org/category/desktop-application/ms-office/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.office-it.org</link>
	<description>All about Web and Desktop Application</description>
	<lastBuildDate>Tue, 20 Jul 2010 23:38:52 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=abc</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Excel: Sort Worksheets Ascending or Descending</title>
		<link>http://www.office-it.org/excel-sort-worksheets-ascending-or-descending/</link>
		<comments>http://www.office-it.org/excel-sort-worksheets-ascending-or-descending/#comments</comments>
		<pubDate>Fri, 31 Oct 2008 12:21:46 +0000</pubDate>
		<dc:creator>Hii Hiong Ching</dc:creator>
				<category><![CDATA[MS Office]]></category>
		<category><![CDATA[excel]]></category>
		<category><![CDATA[VB Code]]></category>

		<guid isPermaLink="false">http://www.office-it.org/?p=205</guid>
		<description><![CDATA[This is VB code which will auto sort all sheets in the active workbook after execute it. It is easy for us to locate sheets when we have many sheets in our workbook.
Write the Code
Open the workbook for which we want to sort the sheets and press Alt + F11 to open the Visual Basic [...]]]></description>
			<content:encoded><![CDATA[<p>This is VB code which will auto sort all sheets in the active workbook after execute it. It is easy for us to locate sheets when we have many sheets in our workbook.</p>
<h3>Write the Code</h3>
<p>Open the workbook for which we want to sort the sheets and press Alt + F11 to open the Visual Basic Editor, and select Insert > Module to insert a module. Copy and paste the following code in module just created.</p>
<p><span id="more-205"></span>
<pre lang="php">
Sub SortSheets()
Dim lCount As Long, lCounted As Long
Dim lShtLast As Long
Dim lReply As Long

lReply = MsgBox("To sort Worksheets ascending, select 'Yes'. " _
&#038; "To sort Worksheets descending select 'No'", vbYesNoCancel, _
"Sheet Sort")
If lReply = vbCancel Then Exit Sub

lShtLast = Sheets.Count

If lReply = vbYes Then 'Sort ascending
    For lCount = 1 To lShtLast
        For lCount2 = lCount To lShtLast
            If UCase(Sheets(lCount2).Name) < UCase(Sheets(lCount).Name) Then
                Sheets(lCount2).Move Before:=Sheets(lCount)
            End If
        Next lCount2
    Next lCount
Else 'Sort descending
    For lCount = 1 To lShtLast
        For lCount2 = lCount To lShtLast
            If UCase(Sheets(lCount2).Name) > UCase(Sheets(lCount).Name) Then
                Sheets(lCount2).Move Before:=Sheets(lCount)
            End If
        Next lCount2
    Next lCount
End If

End Sub
</pre>
<p>Now close your Visual Basic Editor and return to your worksheet and save it.</p>
<h3>Running the Code</h3>
<p>To do this, press Alt + F8, select the macro named &#8220;SortSheets&#8221;, and press Run. You will be asked the way you sort your sheets either in ascending (A &#8211; Z) or descending order (Z &#8211; A).</p>
<p>This VB Code works with all version of Excel.</p>
<img src="http://www.office-it.org/?ak_action=api_record_view&id=205&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://www.office-it.org/excel-sort-worksheets-ascending-or-descending/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Excel: How to Unprotect Worksheet Without Password</title>
		<link>http://www.office-it.org/excel-how-to-unprotect-worksheet-without-password/</link>
		<comments>http://www.office-it.org/excel-how-to-unprotect-worksheet-without-password/#comments</comments>
		<pubDate>Thu, 05 Jun 2008 01:13:13 +0000</pubDate>
		<dc:creator>Hii Hiong Ching</dc:creator>
				<category><![CDATA[MS Office]]></category>
		<category><![CDATA[excel]]></category>
		<category><![CDATA[macro]]></category>
		<category><![CDATA[password]]></category>
		<category><![CDATA[unprotect]]></category>
		<category><![CDATA[VBA]]></category>

		<guid isPermaLink="false">http://www.office-it.org/?p=176</guid>
		<description><![CDATA[You may sometimes forgot your password of your Microsoft Excel sheet or workbook, or the original author (usually ex-colleague) lock the workbook and didn&#8217;t unlock it for next user, the marco below will unlock your sheet or workbook not matter what your original password is. However, it will NOT report the original password.
How to unprotect
1. [...]]]></description>
			<content:encoded><![CDATA[<p>You may sometimes forgot your password of your Microsoft Excel sheet or workbook, or the original author (usually ex-colleague) lock the workbook and didn&#8217;t unlock it for next user, the marco below will unlock your sheet or workbook not matter what your original password is. However, it will NOT report the original password.</p>
<h3>How to unprotect</h3>
<p>1. First open your protected excel file<br />
2. Launch the Visual Basic Editor<br />
3. Copy and paste the following VB Code</p>
<p><span id="more-176"></span>
<pre lang="text">
'----------------------------------------------------------------
Option Explicit 

Public Sub AllInternalPasswords()
' Breaks worksheet and workbook structure passwords. Bob McCormick
' probably originator of base code algorithm modified for coverage
' of workbook structure / windows passwords and for multiple passwords
'
' Norman Harker and JE McGimpsey 27-Dec-2002 (Version 1.1)
' Modified 2003-Apr-04 by JEM: All msgs to constants, and
' eliminate one Exit Sub (Version 1.1.1)
' Reveals hashed passwords NOT original passwords 

Const DBLSPACE As String = vbNewLine &#038; vbNewLine
Const AUTHORS As String = DBLSPACE &#038; vbNewLine &#038; _
"Adapted from Bob McCormick base code by" &#038; _
"Norman Harker and JE McGimpsey"
Const HEADER As String = "AllInternalPasswords User Message"
Const VERSION As String = DBLSPACE &#038; "Version 1.1.1 2003-Apr-04"
Const REPBACK As String = DBLSPACE &#038; "Please report failure " &#038; _
"to the microsoft.public.excel.programming newsgroup."
Const ALLCLEAR As String = DBLSPACE &#038; "The workbook should " &#038; _
"now be free of all password protection, so make sure you:" &#038; _
DBLSPACE &#038; "SAVE IT NOW!" &#038; DBLSPACE &#038; "and also" &#038; _
DBLSPACE &#038; "BACKUP!, BACKUP!!, BACKUP!!!" &#038; _
DBLSPACE &#038; "Also, remember that the password was " &#038; _
"put there for a reason. Don't stuff up crucial formulas " &#038; _
"or data." &#038; DBLSPACE &#038; "Access and use of some data " &#038; _
"may be an offense. If in doubt, don't."
Const MSGNOPWORDS1 As String = "There were no passwords on " &#038; _
"sheets, or workbook structure or windows." &#038; AUTHORS &#038; VERSION
Const MSGNOPWORDS2 As String = "There was no protection to " &#038; _
"workbook structure or windows." &#038; DBLSPACE &#038; _
"Proceeding to unprotect sheets." &#038; AUTHORS &#038; VERSION
Const MSGTAKETIME As String = "After pressing OK button this " &#038; _
"will take some time." &#038; DBLSPACE &#038; "Amount of time " &#038; _
"depends on how many different passwords, the " &#038; _
"passwords, and your computer's specification." &#038; DBLSPACE &#038; _
"Just be patient! Make me a coffee!" &#038; AUTHORS &#038; VERSION
Const MSGPWORDFOUND1 As String = "You had a Worksheet " &#038; _
"Structure or Windows Password set." &#038; DBLSPACE &#038; _
"The password found was: " &#038; DBLSPACE &#038; "$$" &#038; DBLSPACE &#038; _
"Note it down for potential future use in other workbooks by " &#038; _
"the same person who set this password." &#038; DBLSPACE &#038; _
"Now to check and clear other passwords." &#038; AUTHORS &#038; VERSION
Const MSGPWORDFOUND2 As String = "You had a Worksheet " &#038; _
"password set." &#038; DBLSPACE &#038; "The password found was: " &#038; _
DBLSPACE &#038; "$$" &#038; DBLSPACE &#038; "Note it down for potential " &#038; _
"future use in other workbooks by same person who " &#038; _
"set this password." &#038; DBLSPACE &#038; "Now to check and clear " &#038; _
"other passwords." &#038; AUTHORS &#038; VERSION
Const MSGONLYONE As String = "Only structure / windows " &#038; _
"protected with the password that was just found." &#038; _
ALLCLEAR &#038; AUTHORS &#038; VERSION &#038; REPBACK
Dim w1 As Worksheet, w2 As Worksheet
Dim i As Integer, j As Integer, k As Integer, l As Integer
Dim m As Integer, n As Integer, i1 As Integer, i2 As Integer
Dim i3 As Integer, i4 As Integer, i5 As Integer, i6 As Integer
Dim PWord1 As String
Dim ShTag As Boolean, WinTag As Boolean 

Application.ScreenUpdating = False
With ActiveWorkbook
WinTag = .ProtectStructure Or .ProtectWindows
End With
ShTag = False
For Each w1 In Worksheets
ShTag = ShTag Or w1.ProtectContents
Next w1
If Not ShTag And Not WinTag Then
MsgBox MSGNOPWORDS1, vbInformation, HEADER
Exit Sub
End If
MsgBox MSGTAKETIME, vbInformation, HEADER
If Not WinTag Then
MsgBox MSGNOPWORDS2, vbInformation, HEADER
Else
On Error Resume Next
Do 'dummy do loop
For i = 65 To 66: For j = 65 To 66: For k = 65 To 66
For l = 65 To 66: For m = 65 To 66: For i1 = 65 To 66
For i2 = 65 To 66: For i3 = 65 To 66: For i4 = 65 To 66
For i5 = 65 To 66: For i6 = 65 To 66: For n = 32 To 126
With ActiveWorkbook
.Unprotect Chr(i) &#038; Chr(j) &#038; Chr(k) &#038; _
Chr(l) &#038; Chr(m) &#038; Chr(i1) &#038; Chr(i2) &#038; _
Chr(i3) &#038; Chr(i4) &#038; Chr(i5) &#038; Chr(i6) &#038; Chr(n)
If .ProtectStructure = False And _
.ProtectWindows = False Then
PWord1 = Chr(i) &#038; Chr(j) &#038; Chr(k) &#038; Chr(l) &#038; _
Chr(m) &#038; Chr(i1) &#038; Chr(i2) &#038; Chr(i3) &#038; _
Chr(i4) &#038; Chr(i5) &#038; Chr(i6) &#038; Chr(n)
MsgBox Application.Substitute(MSGPWORDFOUND1, _
"$$", PWord1), vbInformation, HEADER
Exit Do 'Bypass all for...nexts
End If
End With
Next: Next: Next: Next: Next: Next
Next: Next: Next: Next: Next: Next
Loop Until True
On Error GoTo 0
End If
If WinTag And Not ShTag Then
MsgBox MSGONLYONE, vbInformation, HEADER
Exit Sub
End If
On Error Resume Next
For Each w1 In Worksheets
'Attempt clearance with PWord1
w1.Unprotect PWord1
Next w1
On Error GoTo 0
ShTag = False
For Each w1 In Worksheets
'Checks for all clear ShTag triggered to 1 if not.
ShTag = ShTag Or w1.ProtectContents
Next w1
If ShTag Then
For Each w1 In Worksheets
With w1
If .ProtectContents Then
On Error Resume Next
Do 'Dummy do loop
For i = 65 To 66: For j = 65 To 66: For k = 65 To 66
For l = 65 To 66: For m = 65 To 66: For i1 = 65 To 66
For i2 = 65 To 66: For i3 = 65 To 66: For i4 = 65 To 66
For i5 = 65 To 66: For i6 = 65 To 66: For n = 32 To 126
.Unprotect Chr(i) &#038; Chr(j) &#038; Chr(k) &#038; _
Chr(l) &#038; Chr(m) &#038; Chr(i1) &#038; Chr(i2) &#038; Chr(i3) &#038; _
Chr(i4) &#038; Chr(i5) &#038; Chr(i6) &#038; Chr(n)
If Not .ProtectContents Then
PWord1 = Chr(i) &#038; Chr(j) &#038; Chr(k) &#038; Chr(l) &#038; _
Chr(m) &#038; Chr(i1) &#038; Chr(i2) &#038; Chr(i3) &#038; _
Chr(i4) &#038; Chr(i5) &#038; Chr(i6) &#038; Chr(n)
MsgBox Application.Substitute(MSGPWORDFOUND2, _
"$$", PWord1), vbInformation, HEADER
'leverage finding Pword by trying on other sheets
For Each w2 In Worksheets
w2.Unprotect PWord1
Next w2
Exit Do 'Bypass all for...nexts
End If
Next: Next: Next: Next: Next: Next
Next: Next: Next: Next: Next: Next
Loop Until True
On Error GoTo 0
End If
End With
Next w1
End If
MsgBox ALLCLEAR &#038; AUTHORS &#038; VERSION &#038; REPBACK, vbInformation, HEADER
End Sub
'----------------------------------------------------------------
</pre>
<p>4. Then press Run button, all internal password will be removed.</p>
<p>If you really don&#8217;t know how to do or lazy to copy and cut, you can download the workbook attached below. The workbook is hidden, and has an attached toolbar with a button to start the macro. Activate the workbook you want to unlock and click the button. The code is unlocked so you may examine and modify it as needed. Note: This macro cannot unlock password to open.</p>
<p><a href='http://www.office-it.org/wp-content/uploads/2008/06/allinternalpasswords.xls'>Download here</a></p>
<p><strong>DISCLAIMER: Please note that breaking password protection MAY violate laws or regulations in your jurisdiction.</strong></p>
<img src="http://www.office-it.org/?ak_action=api_record_view&id=176&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://www.office-it.org/excel-how-to-unprotect-worksheet-without-password/feed/</wfw:commentRss>
		<slash:comments>13</slash:comments>
		</item>
		<item>
		<title>Excel: Putting advanced array formulas to work</title>
		<link>http://www.office-it.org/excel-putting-advanced-array-formulas-to-work/</link>
		<comments>http://www.office-it.org/excel-putting-advanced-array-formulas-to-work/#comments</comments>
		<pubDate>Wed, 02 Jan 2008 02:27:27 +0000</pubDate>
		<dc:creator>Hii Hiong Ching</dc:creator>
				<category><![CDATA[MS Office]]></category>
		<category><![CDATA[array]]></category>
		<category><![CDATA[formula]]></category>

		<guid isPermaLink="false">http://office-it.org/?p=6</guid>
		<description><![CDATA[Sum a range that contains error values
The SUM function in Microsoft Excel doesn&#8217;t work when you try to sum a range that contains an error value such as #N/A. This example shows you how to sum the values in a range named &#8220;Data&#8221; that contains errors:
=SUM(IF(ISERROR(Data),"",Data))
The formula creates a new array that contains the original [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Sum a range that contains error values</strong></p>
<p>The SUM function in Microsoft Excel doesn&#8217;t work when you try to sum a range that contains an error value such as #N/A. This example shows you how to sum the values in a range named &#8220;Data&#8221; that contains errors:</p>
<pre lang="text">=SUM(IF(ISERROR(Data),"",Data))</pre>
<p>The formula creates a new array that contains the original values minus any error values. Starting from the inner functions and working outward, the ISERROR function searches the cell range (Data) for errors. The IF function returns one value if a condition you specify evaluates to TRUE, and another value if it evaluates to FALSE. In this case, it returns empty strings (&#8220;&#8221;) for all error values because they evaluate to TRUE, and the remaining values from the range (Data again) because they evaluate to FALSE, meaning that they don&#8217;t contain error values. The SUM function then calculates the total for the filtered array.</p>
<p><span id="more-6"></span><strong>Count the number of error values in a range</strong></p>
<p>This example is similar to the previous formula, but it returns the number of error values in a range named &#8220;Data&#8221; instead of filtering them out:</p>
<pre lang="text">=SUM(IF(ISERROR(Data),1,0))</pre>
<p>This formula creates an array of 1s for the cells that contain errors, and 0s for the cells that don&#8217;t. You can simplify the formula and achieve the same result by removing the third argument for the IF function, like so:</p>
<pre lang="text">=SUM(IF(ISERROR(Data),1))</pre>
<p>If you don&#8217;t specify the argument, the function returns FALSE if a cell does not contain an error value. You can simplify the formula even more:</p>
<pre lang="text">=SUM(IF(ISERROR(Data)*1))</pre>
<p>This version works because TRUE*1=1 and FALSE*1=0.</p>
<p><strong>Sum values based on conditions</strong></p>
<p>You often need to sum values based on conditions. For example, this array formula sums just the positive integers in a range named &#8220;Sales&#8221;:</p>
<pre lang="text">=SUM(IF(Sales&gt;0,Sales))</pre>
<p>The IF function creates an array of positive values and false values. The SUM function essentially ignores the false values because 0+0=0. The cell range that you use in this formula can consist of any number of rows and columns.</p>
<p>You can also sum values that meet more than one condition. For example, this array formula calculates values greater than zero and less than or equal to five:</p>
<pre lang="text">=SUM((Sales&gt;0)*(Sales&lt; =5)*(Sales))</pre>
<p>Keep in mind that this formula returns an error if the range contains one or more non-numeric cells.</p>
<p>You can also create array formulas that use a type of OR condition. For example, you can sum values that are less than 5 and greater than 15:</p>
<pre lang="text">=SUM(IF((Sales&lt;5)+(Sales&gt;15),Sales))</pre>
<p>The IF function finds all values smaller than 5 and greater than 15 and then passes those values to the SUM function.</p>
<p>Important  You can&#8217;t use the AND and OR functions in array formulas directly. Why not? Those functions return a single result, either TRUE or FALSE, and array functions require arrays of results. You can work around the problem by using the logic shown in the previous formula. In other words, you perform math operations such as addition or multiplication on values that meet the OR or AND condition.</p>
<p><strong>Compute an average that excludes zeros</strong></p>
<p>This example shows you how to remove zeros from a range when you need to average the values in that range. The formula uses a data range named &#8220;Sales&#8221;:</p>
<pre lang="text">=AVERAGE(IF(Sales&lt;&gt;0,Sales))</pre>
<p>The IF function creates an array of values that do not equal zero and then passes those values to the AVERAGE function.</p>
<p><strong>Count the number of differences between two ranges of cells</strong></p>
<p>This array formula compares the values in two ranges of cells named &#8220;MyData&#8221; and &#8220;YourData&#8221; and returns the number of differences between the two. If the contents of the two ranges are identical, the formula returns 0. To use this formula, the cell ranges must be the same size and of the same dimension:</p>
<pre lang="text">=SUM(IF(MyData=YourData,0,1))</pre>
<p>The formula creates a new array of the same size as the ranges that you&#8217;re comparing. The IF function fills the array with 0s and 1s (0s for mismatches and 1s for identical cells). The SUM function then returns the sum of the values in the array.</p>
<p>You can simplify the formula like this:</p>
<pre lang="text">=SUM(1*(MyData&lt;&gt;YourData))</pre>
<p>Like the formula that counts error values in a range, this formula works because TRUE*1=1, and FALSE*1=0.</p>
<p><strong>Find the location of the maximum value in a range</strong></p>
<p>This array formula returns the row number of the maximum value in a single-column range named &#8220;Data&#8221;:</p>
<pre lang="text">=MIN(IF(Data=MAX(Data),ROW(Data),""))</pre>
<p>The IF function creates a new array that corresponds to the &#8220;Data&#8221; range. If a corresponding cell contains the maximum value in the range, the array contains the row number. Otherwise, the array contains an empty string (&#8220;&#8221;). The MIN function uses the new array as its second argument and returns the smallest value, which corresponds to the row number of the maximum value in &#8220;Data.&#8221; If the &#8220;Data&#8221; range contains identical maximum values, the formula returns the row of the first value.</p>
<p>If you want to return the actual cell address of a maximum value, use this formula:</p>
<pre lang="text">=ADDRESS(MIN(IF(Data=MAX(Data),ROW(Data),"")),COLUMN(Data))</pre>
<p>Source: http://office.microsoft.com/en-us/excel/HA010872271033.aspx</p>
<img src="http://www.office-it.org/?ak_action=api_record_view&id=6&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://www.office-it.org/excel-putting-advanced-array-formulas-to-work/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Excel: Extracting numbers from alphanumeric strings</title>
		<link>http://www.office-it.org/excel-extracting-numbers-from-alphanumeric-strings/</link>
		<comments>http://www.office-it.org/excel-extracting-numbers-from-alphanumeric-strings/#comments</comments>
		<pubDate>Mon, 24 Dec 2007 17:56:00 +0000</pubDate>
		<dc:creator>Hii Hiong Ching</dc:creator>
				<category><![CDATA[MS Office]]></category>
		<category><![CDATA[alphanumeric]]></category>
		<category><![CDATA[extract]]></category>
		<category><![CDATA[number]]></category>
		<category><![CDATA[string]]></category>

		<guid isPermaLink="false">http://office-it.org/?p=8</guid>
		<description><![CDATA[This article was written by Ashish Mathur, a Microsoft MVP (Most Valuable Professional).  Visit the Microsoft MVP Web site for more information.
In the following article I explain a formula that extracts numbers from strings in the following types of situations:

When alphabetic and number characters are clustered together, such as abc123 or 				678sfr.
	When alphabetic and [...]]]></description>
			<content:encoded><![CDATA[<p>This article was written by Ashish Mathur, a Microsoft MVP (Most Valuable Professional).  Visit the <a href="http://mvp.support.microsoft.com/">Microsoft MVP Web site</a> for more information.</p>
<p>In the following article I explain a formula that extracts numbers from strings in the following types of situations:</p>
<ul>
<li>When alphabetic and number characters are clustered together, such as <code>abc123</code> or 				<code>678sfr</code>.</li>
<li>	When alphabetic and number characters are not clustered together, such as <code>abc15tni</code>.</li>
</ul>
<p><strong>Problem</strong></p>
<p>How to extract the numeric portion of an alphanumeric string. For example: If cell A1 contains the string &#8220;abc123&#8243;, return the value 123 in cell B1.</p>
<p><strong>Solution</strong></p>
<p>The underlying logic here is to search for and return the first number in the alphanumeric string, and then return only the numbers that follow.</p>
<p><span id="more-8"></span><strong>Algorithm</strong></p>
<p>The solution involves creating formulas to accomplish the following  tasks:</p>
<ol>
<li>	Break the alphanumeric string into separate characters.</li>
<li>Determine whether there is a number in the decomposed string.</li>
<li>Determine the position of the number in the alphanumeric string.</li>
<li>Count the numbers in the alphanumeric string.</li>
</ol>
<p>We will consider each of these tasks separately, and then integrate the formulas to achieve the final result.</p>
<p><strong>Break the alphanumeric string into separate characters</strong></p>
<p>Use the MID function here. MID returns a specific number of characters from a text string, starting at the position you specify, based on the number of characters you specify. The syntax of the function is:</p>
<p><code>MID(text,start_num,num_chars)</code></p>
<ul>
<li><strong class="runinhead">  Text</strong>  The text string containing the characters you want to extract.</li>
<li><strong class="runinhead">Start_num</strong>  The position of the first character you want to extract in text. The first character in text has start_num 1, and so on.</li>
<li><strong class="runinhead">Num_chars</strong>  Specifies the number of characters you want MID to return from text.</li>
</ul>
<p>For our example, the formula is:</p>
<pre lang="text">=MID(A1,ROW($1:$9),1)</pre>
<p>This formula decomposes the alphanumeric string and puts the characters — virtually — into different rows of the worksheet. For example, for alphanumeric string <code>abc123</code>, all the 6 characters would be segregated.</p>
<p><strong>Note</strong>  The number 9 may be suitably increased to any higher number to accommodate larger strings. In this example, the maximum string length is 9.</p>
<p>It is worthwhile to note that when the string is decomposed, &#8220;1&#8243;, &#8220;2&#8243; and &#8220;3&#8243; are treated as text — not as numbers.  To convert the numbers stored as text into numbers, multiply the formula by 1.  For example:</p>
<pre lang="text">=1*MID(A1,ROW($1:$9),1)</pre>
<p><strong>Determine whether there is a number in the decomposed string</strong></p>
<p>Here we employ the ISNUMBER function, which determines whether there is a number in the alphanumeric string. The formula now becomes:</p>
<pre lang="text">=ISNUMBER(1*MID(A1,ROW($1:$9),1))</pre>
<p>If there is a number in the string, the result is TRUE, otherwise it is FALSE.</p>
<p><strong>Determine the position of the number in the alphanumeric string</strong></p>
<p>Now we determine the position of the number by locating a TRUE value in the result of the decomposed string mentioned in the paragraph above. We employ the MATCH function here. The revised formula now becomes:</p>
<pre lang="text">=MATCH(TRUE,ISNUMBER(1*MID(A1,ROW($1:$9),1)),0)</pre>
<p><strong><font color="red">Important</font></strong>  You must enter this formula as  an array by pressing CTRL+SHIFT+ENTER.</p>
<p>If the string is <code>abc123</code>, this formula will yield 4 — that being the position of the first numeric character in the alphanumeric string.</p>
<p><strong>Count the numbers in the alphanumeric string</strong></p>
<p>The task now is to count the numbers in the string, to determine the characters to be returned after the first number in the alphanumeric string.</p>
<p>As mentioned above, the numbers stored as text in the alphanumeric string can be converted into numbers by multiplying them by 1. For example, <code>=1*MID(A1,ROW($1:$9),1)</code></p>
<p>After the numbers stored as text are converted to numbers, it is possible to count them by using the COUNT function. The numbers can be counted by entering the following formula:</p>
<pre lang="text">=COUNT(1*MID(A1,ROW($1:$9),1))</pre>
<p><strong>Integrate the formulas</strong></p>
<p>We now employ the MID function to integrate the various parts of the formula, as shown in the following example.</p>
<pre lang="text">=MID(A1,MATCH(TRUE,ISNUMBER(1*MID(A1,ROW($1:$9),1)),0),COUNT(1*MID(A1,ROW($1:$9),1)))</pre>
<p>In basic terms, the problem can now be stated as: Determine the position of the first number in the alphanumeric string (in cell A1). Return that number and the numbers that follow.</p>
<p>To convert the resulting characters to numbers, multiply the formula by 1. While this is not strictly required, it should be done if you are going to perform mathematical operations on the result. This is the final formula to be entered in cell B1:</p>
<pre lang="text">=1*MID(A1,MATCH(TRUE,ISNUMBER(1*MID(A1,ROW($1:$9),1)),0),COUNT(1*MID(A1,ROW($1:$9),1)))</pre>
<p><strong><font color="red">Important</font></strong>  You must enter these formulas  as arrays by pressing CTRL+SHIFT+ENTER.</p>
<p><strong>More examples</strong></p>
<p>To test the formula further, enter the  data in the following picture into cells A1:A7 of a blank worksheet.</p>
<p><img src="http://office.microsoft.com/global/images/default.aspx?AssetID=ZA011549041033" alt="Example of string conversion" border="0" /></p>
<p>Enter the formula in cell B1, and then use AutoFill copy the formula into cells B2:B7. (Remember to press CTRL+SHIFT+ENTER.)</p>
<p>It is worth mentioning here that if the string is <code>yur09875reew</code> and if you use the formula that is multiplied by 1, the result in column B will be 9875 and not 09875. Since 0*1=0, the 0 is ignored and the result returned is 9875. If you want the result to be 09875, do not multiply the complete formula by 1.</p>
<img src="http://www.office-it.org/?ak_action=api_record_view&id=8&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://www.office-it.org/excel-extracting-numbers-from-alphanumeric-strings/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Excel: Conditional formatting: Considering the fourth option</title>
		<link>http://www.office-it.org/excel-conditional-formatting-considering-the-fourth-option/</link>
		<comments>http://www.office-it.org/excel-conditional-formatting-considering-the-fourth-option/#comments</comments>
		<pubDate>Mon, 24 Dec 2007 05:53:07 +0000</pubDate>
		<dc:creator>Hii Hiong Ching</dc:creator>
				<category><![CDATA[MS Office]]></category>
		<category><![CDATA[conditional formatting]]></category>

		<guid isPermaLink="false">http://office-it.org/?p=7</guid>
		<description><![CDATA[This article was adapted from MrExcel.com. Visit the MrExcel.com Web site for more tips and information.
Conditional formatting in Excel allows for three conditions. However, by setting up conditions correctly — from least to most restrictive — you can really allow for four conditions, when the default formatting of the cell is considered. For example, say [...]]]></description>
			<content:encoded><![CDATA[<p>This article was adapted from MrExcel.com. Visit the <a href="http://www.mrexcel.com/">MrExcel.com Web site</a> for more tips and information.</p>
<p>Conditional formatting in Excel allows for three conditions. However, by setting up conditions correctly — from least to most restrictive — you can really allow for four conditions, when the default formatting of the cell is considered. For example, say you want to add color to your data like so:</p>
<table style="border: 1px solid #333333" cellpadding="0" cellspacing="0" height="78" width="240">
<tr>
<th style="background-color: #333333; color: #ffffff">If cell value is</th>
<th style="background-color: #333333; color: #ffffff">Fill with</th>
</tr>
<tr>
<td>Less than or equal to -25</td>
<td>Red</td>
</tr>
<tr>
<td>Between 0 and -25</td>
<td>Yellow</td>
</tr>
<tr>
<td>Between 0 and 25</td>
<td>Green</td>
</tr>
<tr>
<td>Over 25</td>
<td>Black</td>
</tr>
</table>
<p><span id="more-7"></span>This can be achieved by doing the following:</p>
<ol>
<li>Select your range of cells.</li>
<li>Click <strong class="ui">Conditional Formatting</strong> on the <strong class="ui">Format</strong> menu.</li>
<li>Under <strong class="ui">Condition 1</strong>, in the first two boxes, choose <strong class="ui">Cell Value Is</strong> and <strong class="ui">less than or equal to</strong>. Then type the value <strong>-25</strong> in the third box.</li>
<li>Now click the <strong class="ui">Format</strong> button, choose a red fill color from the <strong class="ui">Patterns</strong> tab, and then click <strong class="ui">OK</strong>.</li>
<li>Click <strong class="ui">Add</strong>. Under <strong class="ui">Condition 2</strong>, choose <strong class="ui">between</strong> in the second box, type the values to <strong>0</strong> and <strong>-25</strong> in the third and fourth boxes, and then choose a yellow fill format.</li>
<li>Click <strong class="ui">Add</strong> again. Under <strong class="ui">Condition 3</strong>, choose <strong class="ui">between</strong> in the second box, type the values to <strong>0</strong> and <strong>25</strong> in the third and fourth boxes, and then choose a green fill format.</li>
<li>Click <strong class="ui">OK</strong> to close the <strong class="ui">Conditional Formatting</strong> dialog box.</li>
<li>Finally, while your range is still highlighted, choose a black fill from the color palette.</li>
</ol>
<p>Your range is now pseudo-conditionally formatted to cover all four cases.</p>
<img src="http://www.office-it.org/?ak_action=api_record_view&id=7&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://www.office-it.org/excel-conditional-formatting-considering-the-fourth-option/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
