#### Comparison of Columns

```I have three columns thast represent Set numbers, I want to compare the
values in column "B" with those in column "A" find where they match and then
calculate how many rows they have moved either up or down and put the answer
in column "C"

Col A         Col B      Col C
1127         1129         +1
1129         1130         +1
1130	1132	+3
1102	1102	0
1131	1131	0
1132	1133	+1
1133	1135	+1
1135	1137	+2
1062	1138	+2
1137	1062	-1
1138	1141
```
 0
Utf
1/21/2010 2:23:01 PM
excel.misc 78881 articles. 5 followers.

3 Replies
491 Views

Similar Articles

[PageSpeed] 57

```You need to provide much more detail. For example, what exactly do you
mean by "where they match"? Where what matches what? Also, you need to
explain how the value in column C is to be calculated. For example, in
the first row of you example data you have 1127 and 1129 and a result
of +1. Why is this 1 when the difference between 1127 and 1129 is 2,
not 1, especially in light of the fact that in the second row you have
1129 and 1130 also yielding a result of +1. Why does the first row get
a result of 1, not 2? You need to explain in detail what it is that
you want to compare and the meaning of the results.

Cordially,
Chip Pearson
Microsoft MVP 1998 - 2010
Pearson Software Consulting, LLC
www.cpearson.com
[email on web site]

On Thu, 21 Jan 2010 06:23:01 -0800, Rob
<Rob@discussions.microsoft.com> wrote:

>I have three columns thast represent Set numbers, I want to compare the
>values in column "B" with those in column "A" find where they match and then
>calculate how many rows they have moved either up or down and put the answer
>in column "C"
>
>Col A         Col B      Col C
>1127         1129         +1
>1129         1130         +1
>1130	1132	+3
>1102	1102	0
>1131	1131	0
>1132	1133	+1
>1133	1135	+1
>1135	1137	+2
>1062	1138	+2
>1137	1062	-1
>1138	1141
```
 0
Chip
1/21/2010 5:20:07 PM
```On Jan 21, 6:23=A0am, Rob <R...@discussions.microsoft.com> wrote:
> I have three columns thast represent Set numbers, I want to compare the
> values in column "B" with those in column "A" find where they match and t=
hen
> calculate how many rows they have moved either up or down and put the ans=
wer
> in column "C"
>
> Col A =A0 =A0 =A0 =A0 Col B =A0 =A0 =A0Col C
> 1127 =A0 =A0 =A0 =A0 1129 =A0 =A0 =A0 =A0 +1
> 1129 =A0 =A0 =A0 =A0 1130 =A0 =A0 =A0 =A0 +1
> 1130 =A0 =A01132 =A0 =A0+3
> 1102 =A0 =A01102 =A0 =A00
> 1131 =A0 =A01131 =A0 =A00
> 1132 =A0 =A01133 =A0 =A0+1
> 1133 =A0 =A01135 =A0 =A0+1
> 1135 =A0 =A01137 =A0 =A0+2
> 1062 =A0 =A01138 =A0 =A0+2
> 1137 =A0 =A01062 =A0 =A0-1
> 1138 =A0 =A01141 =A0 =A0

Here's one way with Excel 2003.

First, in C1 put
=3DIF(COUNTIF(A:A,B1)=3D0,"",MATCH(B1,A:A,0)-ROW())
and copy downward.

Then select column C and use
Format > Cells > Number
and for "Category" choose "Custom"
and for "Type" put
+0;-0;0

Hope this helps getting started.
```
 0
zvkmpw
1/22/2010 11:58:58 PM
```Thank you both for your time

"zvkmpw" wrote:

> On Jan 21, 6:23 am, Rob <R...@discussions.microsoft.com> wrote:
> > I have three columns thast represent Set numbers, I want to compare the
> > values in column "B" with those in column "A" find where they match and then
> > calculate how many rows they have moved either up or down and put the answer
> > in column "C"
> >
> > Col A         Col B      Col C
> > 1127         1129         +1
> > 1129         1130         +1
> > 1130    1132    +3
> > 1102    1102    0
> > 1131    1131    0
> > 1132    1133    +1
> > 1133    1135    +1
> > 1135    1137    +2
> > 1062    1138    +2
> > 1137    1062    -1
> > 1138    1141
>
> Here's one way with Excel 2003.
>
> First, in C1 put
>   =IF(COUNTIF(A:A,B1)=0,"",MATCH(B1,A:A,0)-ROW())
> and copy downward.
>
> Then select column C and use
>   Format > Cells > Number
> and for "Category" choose "Custom"
> and for "Type" put
>   +0;-0;0
>
> Hope this helps getting started.
> .
>
```
 0
Utf
1/28/2010 12:02:01 PM

Similar Artilces:

Counting text in a column
I used to think I was good at Excel until this stumped me. I have a column with a variety of text in each cell. Example: A1 bob bob ted ted ted charley charley charley charley, etc. Is there a formula or way I can take the whole column of data and hav it come back with something similar to: bob = 2 ted=3 charley=4 etc. for all the variables in the column? Please help, I am dying over here -- prom4 ----------------------------------------------------------------------- prom4x's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=2901 View this thread: http://www...

Do a two way lookup and get the result in multiple columns
Hi, I have a worksheet with data on store sales: StoreLoc Date Sales\$ A 10/28/2005 \$100 A 11/04/2005 \$150 B 10/28/2005 \$200 B 11/04/2005 \$250 B 11/11/2005 \$300 B 11/18/2005 \$350 C 11/04/2005 \$300 C 11/11/2005 \$350 C 11/18/2005 \$400 D 11/11/2005 \$400 etc. I wanted to do a two-way lookup on StoreLoc and Date and get the sal...

Subtotals by Column
Hi, Need a support in: Making subtotals by column not by row. Usually when I go Data-->Subtotals.., It offers me: At each change in.. and then a series of column names. Well I need to do it the other way.It's like traspose the outline. I've seen it on a file but do not know how to do it. Please any help is welcome -- Edgar Rey Hi, Did you tried Subtotal(). "Edgar" wrote: > Hi, Need a support in: > Making subtotals by column not by row. Usually when I go Data-->Subtotals.., > It offers me: At each change in.. and then a series of column nam...

A formula that only shows the number of ex: "A" in a column and
Hi! Can i make a formula that only shows the number of ex: "A" in a column and ignore any hidden rows that result from filtering. Maybe i ca combine =SUBTOTAL(3;P:P) and =COUNTIF(\$P:\$P;"=A") in some way? Regards Gunnar Gunnar, You basically need to reproduce your filtering: =SUMPRODUCT((P1:P10="A")*(B1:B10="B")*(C1:C10="C")*1) HTH, Bernie MS Excel MVP "Gunnar Sandstr�m" <gunnar.sandstrom@ericsson.com> wrote in message news:c9n09c\$hh2\$1@newstree.wise.edt.ericsson.se... > Hi! > Can i make a formula that only shows ...

Sum From Beginning of Column #2
How do I create a formula that adds from the top of a column? Here's the situation. I have a column of numbers (with a header of "Pay"). To the right of that colum I want to keep a running total ("Yearly Total"). Every time I get paid, I'm going to enter the amount in the pay column and then I want the Yearly Total column to automatically add it. When I create a fomula (say =SUM(B2:B21)), and propigate it down, it doesn't start at the top. In others words the next formula is =SUM(B3:B22). I want it to be =SUM(B2:B22). And, if a value is not filled in on t...

Removing in column B when listed in Column A
Hi I have a list of text in column A aaaa bbbb ccccc dddd eeee ffff etc.... I also have a list in column B zzzz ccccc xxxx aaaa ffff gggg etc What I need to do is remove all the entries in colum a from column B In the example above I would have in column B left zzzz xxxx gggg Hope this makes sence and someone can help. Thanks Iai -- Message posted from http://www.ExcelForum.com Iain, I assume your colums A en B are filled with values A1:A10 and B1:B10 Put in C1 the formula : If(ISNA(VLOOKUP(B1,\$A\$1:\$A\$10,1,0)),0,1) and copy down to C10. Copy and paste special / values column...

Hide column in ListView
I have an asp.net web page with a databound ListView showing in Grid format. I would like to conditionally hide a column in the ListView based on a checkbox outside of the ListView. I have a ItemDatabound event and thought the ListViewItemType could be checked but it only has data, insert and blank properties. The checkbox is called ckHasOT and I was planning to check something like If ckHasOT.Checked = False Then .... I would like to hide the column from all Templates (Item, Edit and Insert). Thanks. -- David "DavidC" <dlchase@lifetimeinc.com> wrote...

Switch row with column?
Hello guys, im very new to excel, and im trying to learn. I cant seem to figure out how to switch my chart around. I have a list of companies on the top, and down the left i have a list of locations. How can i make the locations go on top, and the companies down the left? -- jason57gizmo ------------------------------------------------------------------------ jason57gizmo's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=30700 View this thread: http://www.excelforum.com/showthread.php?threadid=503627 Depending on the number of rows you're using--since t...

How can I NOT include relationship columns in child nodes?
I am trying to create an XML file with nested 'child' data. I have multiple columns that comprise the data relation(s). How can I NOT include the related columns in the child nodes? Code below (should be able to cut, paste, and run directly). ------------------------------------------------------------------------------ -------- 'Instantiate a new dataset. Dim MyTrx As New DataSet 'Name the dataset. MyTrx.DataSetName = "OUTPUT" 'Add a transaction table. Dim dtTransaction As New DataTable &...

Export empty columns to Excel
I have a database, and some data in that needs to be imported into another database through Excel. I have no control over this, that's the way it needs to be. These Excel files have certain columns, and not all of them relevant for my database. Can I make a query with the relevant fields from my database, and have the needed columns inserted where appropriate? Also, some of my relevant fields have different names than the Excel template. Can I change the column headings in my query to match the Excel template? For example if you have to export and leave columns 2 and 3 blank an...

Calculating percent of times a value is in a column and total #
Ok so I have a column with values in it. Say A4:A12, the values entered will always be 1, 2, 3, or 4. I need a formula that will calculate the % that say a 1 appears in that range and I need a formula that will calculate the total number of 1s in that range. Thanks! =countif(a4:a12,1)/count(a4:a12) Format as percent Regards, Fred "clbritt76" <clbritt76@discussions.microsoft.com> wrote in message news:28AFAD8A-88BC-4151-AE7F-5463AA6E9B68@microsoft.com... > Ok so I have a column with values in it. Say A4:A12, the values entered > will > alwa...

large numbers not losing the end without formatting column
Hi, i need to be able to open a .csv file in Excel with large numbers and or Leading zeros without having to put a ' single quote in or format the column as text or import using text to columns so that i do not lose the actual/original data i am passing to Excel - is there anyway to do this or fool Excel in the .csv file into thinking the number field is a text field - i have tried inserting a row at the begininng with only text in each column but Excell still looses leading zeros and chops the ends of the numbers? thanks best regards kevin The problem is that Excel thinks it knows ...

Inbox Columns company
Hi ! I tried to add the column company from contacts to my inbox but the field stays blank. What Iam doing wrong ? Thanks for your help Thomas Radas Any folder view shows only the data in that folder, even though Outlook = lets you think otherwise by allowing you to add fields from different = types of items in the folder. The Company field that you see under All = Contacts Field does not apply to messages.=20 --=20 Sue Mosher, Outlook MVP Author of Microsoft Outlook Programming - Jumpstart for=20 Administrators, Power Users, and Developers http://www.outlookcode.com/jumpst...

Column name from recordset?
Is there a way to get the column name in access while using vba? For example I have a recordset that uses the valus reset1(1), etc. Can I figure out the name of the column it selected? "AJ" <AJ@discussions.microsoft.com> wrote in message news:91F8AF50-25FB-4D8E-9EBF-082D7FD7CF84@microsoft.com... > Is there a way to get the column name in access while using vba? For > example > I have a recordset that uses the valus reset1(1), etc. Can I figure out > the > name of the column it selected? So "reset1" is the name of the recordset? Each field in th...

Total width of multiple columns
Is there a quick way of finding out the total width of several adjacent columns? Hi, I'd be intrigued to understand why you need this but here's one way. Call with =Col_Width() Select a single row of cells and tap F9 to make it re-calculate Function Col_Width() As Variant Dim C As Range Application.Volatile If Selection.Rows.Count > 1 Then Exit Function For Each C In Selection Col_Width = Col_Width + C.ColumnWidth Next End Function -- Mike When competing hypotheses are otherwise equal, adopt the hypothesis that introduces the fewest assumptions while ...

Return column number of matching cell in external range
Cell A1 in open_workbook_1 contains a text string. The same text string will be found somewhere in closed_workbook_1 within the cell range A1:Z100 How can I return to cell A2 in open_workbook_1, the column number of the cell in closed_workbook_2 which contains the text string? Thanks. Nazg�l wrote: > Cell A1 in open_workbook_1 contains a text string. > > The same text string will be found somewhere in closed_workbook_1 > within the cell range A1:Z100 > > How can I return to cell A2 in open_workbook_1, the column number of > the cell in closed_workbook_2 which contain...

merge columns
Greetings. I have data in Column B (same text in each field) that I want to add to all of the fields in Column A (different text in each field) I have tried merge & center and tried to work out how to do a CONCATENATE but am totally stuck. Is there any way to add the sentence in Col B to the end of the text in Col A without cutting and pasting on every line?? Tell me there is an easy way to do this!! If its a formula I need to use - where on earth do you write it?? Many thanks in advance =A1&B1 (as a formula in cell C1, for example) will do your concatenation (or =A1&&quo...

How to remove a wildcard character from text column?
How does one remove a wildcard character from a text string? In this case the text contains an asterisk followed by a slash. */ If you're talking about "Edit - Replace", Precede the asterisk with the tilde ( ~* ) in the "FindWhat" box. -- HTH, RD ============================================== Please keep all correspondence within the Group, so all may benefit! ============================================== "Stace Cameron" <scameron@siumed.edu> wrote in message news:%23oWuV4WrEHA.3396@tk2msftngp13.phx.gbl... How does one remove a wildcard character f...

Need Formula To Identify Lowest Price in Column
I need a formula to identify which vendor has the lowest price for each item *Vendor A Vendor B Vendor C* *Item 1* \$10.00 \$11.00 \$9.00 *Item 2* \$20.00 \$18.00 \$21.00 *Item 3* \$4.25 \$4.90 \$4.65 Thanks / MS +-------------------------------------------------------------------+ |Filename: ExcelSample.JPG | |Download: http://www.excelforum.com/attachment.php?postid=3520 | +-------------------------------------------------------------------+ -- ms10 ------------------------------------------------------------------------ ms...

Moving Column Sums to Rows
What is the simplest way to enter a sequence of values such as =SUM (A1:A100),=SUM (B1:B100),=SUM (C1:C100), etc. into a COLUMN? What is the simplest way of converting simultaneously such values to (\$a\$1:\$a\$100) etc.? I could only find a slow and clumsy method by putting the formula in a row, right dragging, then using F4 on each individual cell before using paste special with transpose. Roger PB Hi Roger, > What is the simplest way to enter a sequence of values such as =SUM > (A1:A100),=SUM (B1:B100),=SUM (C1:C100), etc. into a COLUMN? > =SUM(OFFSET(\$A\$1,0,ROW()-1,1,100...

how do I make columns independent of each other?
I am using Excel 2007 with survey results and would like to sort them by question. There are 6 worksheets of data: one per campus with approximately 50 questions in the survey and 40 replies per campus. It is too cumbersome to manually perform all these steps. I have the questions separated by column and the answers are numerical ratings. I would like to sort these answers by column independently without regard for the other columns. I would also like to determine the percentage of those who answered 1, 2, 3, etc. Is there any way to do this? Thanks, teacher2010 Sometimes k...

Excel ODBC Driver, Get Column Names?
Hello, Can someone please tell me how to retreive the column NAMES from an Excel spreadsheet. I can get the data, but I need to know the column names? Thank you! Robert, Here is an example that reads a sheet and displays the column names Sub ExcelSheet() Dim oConn As Object Dim oRS As Object Dim sFilename As String Dim sConnect As String Dim sSQL As String Dim i As Long sFilename = "c:\Mytest\Volker1.xls" sConnect = "Provider=Microsoft.Jet.OLEDB.4.0;" & _ "Data Source=" & sFilename & ";" & _ ...

DBTYP.NET Studio 2010
DBTYP.NET Studio 2010 - Database Comparison Suite Released Vienna, Austria - March 8, 2010 Today, BYPsoft announced the availability of DBTYP.NET Studio 2010, the newest version of the cross-database comparison tool that compares SQL Server, MySQL and Oracle databases (schema and data). DBTYP.NET Studio 2010 is available for download from http://www.bypsoft.com. With its rich support for schema and data cross-database comparison, DBTYP.NET Studio takes the mystery out of databases, making their comparison practical and easy for programmers and database administrators everywh...

How do I fix my Stacked column chart with grand totals?
I have a series of data which includes different branches of the company (row header) and different years (column headers). I want to create a stacked chart with no labels or values shown, but with the data table at the bottom of the chart. Ideally, I would like the branches to be listed in alphabetical order (as they appear in the original data worksheet). At the bottom of the data table I would like to have the grand total (again, as it appears in the worksheet). The glitch is that I do not want to have the grand total data included in the chart (I only want it for information). ...

Modifying the lookup window with VBA to sort by a column
How do I add VBA code so when I use the lookup button in Payroll Transaction Entry that it will default to the Last Name Sort and start with the name entered on the Payroll Transaction window in the Employee ID field. Thank you, Amy Amy You did not say which version, but if you are using the Advanced Lookup windows, then you can set some defaults for these windows on Tools >> Setup >> Company >> Advanced Lookups. Which will mean you don't need VBA on this window. Kind Regards Eddie Fourie MBS Specialist (Available for outsourced projects) -----Original Message---...