I want to compare two columns and replace any equal values with the value in a specific cell
I want to compare the numbers in two columns and replace all matching numbers in the second columns with the corresponding value from a cell in the same row as the matching number.
Me too.
Barry
Similar Messages
-
Compare two columns and match ALL recurring values, not just the first instance
Hi everybody...
I was looking for a way to compare values in two columns, identifying every duplicate value instance on a third column.
Searching around the forums, I found a solution, albeit a partial one; I am using this formula: =IFERROR("Duplicate in row "&MATCH($A,$B,0),"") along column C, to compare values between columns A and B. When applied, the formula will render the first instance where there is a duplicate; unfortunately MATCH will only register the first instance of the duplicated values.
For example:
The first value on column A is 'Apple'. On column B there are three instances for the value 'Apple', the formula identifies the first of these values, but not the remaining two.
I am not an advanced Numbers or Excel user, and the answer to this problem eludes me. I am attempting to compare columns that have no less than 1000 rows each, so you can imagine how, finding a solution to my problem would be really great.
Thanks in advance,
PabloUnfortunately I can't see your screenshot, but supposing you have a table like this:
Col1
Col2
1
3
Dupe
2
4
Dupe
3
5
Dupe
4
6
5
7
Then here is one way to flag the duplicates.
The formula in C2, copied down, is:
=IF(COUNTIF($A,$B2)≥1,"Dupe","")
Then filter on column C for 'Dupe', and copy the values in column B to wherever you need them.
SG -
I attempted to compare two strings whether they are equal or not. They should return true if both are equal.
One string is based on Taxonomy's Term (i.e. Term.Name) whereas other string is based on String object.
The problem is that both strings which seem equal return false instead of true. Both string values have different special characters though their special characters are & and &
Snapshot of different design & same symbols:
Is it due to different culture or language?
How to compare two strings whether both are equal while ignoring the difference in special characters (& vs &)?Hi Jerioon,
If you have a list of possible ambiguous characters the job is going to be easy and if (& vs &) are the only charracters in concern awesome.
You can use the below solution.
Before comparing pass the variables through a replace function to standarize the char set.
$Var = Replace($Var,"&","&")
This is going to make sure you don't end up with ambiguous characters failing the comparison and all the char are "&" in this case.
Similar technique is used to ignore Character Cases 'a' vs. 'A'
Regards,
Satyajit
Please “Vote As Helpful”
if you find my contribution useful or “Mark As Answer” if it does answer your question. That will encourage me - and others - to take time out to help you. -
How to compare two columns and provide a report
hi guys any idea on this one i have a table in apex
which looks like this Create table Assessments ( USER_ID varchar(40) , Assessed number ) ;
CREATE OR REPLACE TRIGGER "TABLE_IMP_T1"
BEFORE
insert on "TABLE_IMP"
for each row
begin
:NEW.USER_ID := nvl(v('APP_USER'),USER);
:NEW.ASSESSED := ('1');
end;
The data in this table looks like after some inserts USER_ID ASSESSED
user1@mail 1
user2@mail 1
user3@mail 2
user4@mail 7
Then i have another table that has fixed values in it which is called Assessments_complete the data in this table looks like USER_ID Assessments_2do
user1@mail 1
user2@mail 1
user3@mail 3
user4@mail 10
What id like to do is create a report in apex that compares the to tables and would have columns in the report to shows the USER_ID , ASSESSED , Completed so it would look something like
USER_ID ASSESSSED COMPLETE
USER1@MAIL 1 yes
USER2@MAIL 1 yes
USER3@MAIL 2 no
USER4@MAIL 7 no
So why it shows no for user3@mail and user4@mail is because there Assessments 2do is not he same as Assessed
Any ideas guysSCW,
I'm sure there is a clever way to cascade functions to avoid adding an auxiliary column in your practice table, but to me it wouldn't be worth the aggravation. I would add a column that concatenates Columns A & B, AWG & mils. This column can be anywhere and would be Hidden. Let's say your new column is Column N.
In Column N, fill the body rows with:
=A&"-"&B
As good Numbers programming form would indicate, let's name the Practice Table Practices and only put the practices in that table. In another table where you do the lookup, let's call it Program, we will have the calculation/lookup.
Based on your example, I'd guess that AWG may be in Column D and mils in Column E of your Program table, and the Soak lookup in Column F. If I'm wrong, adjust the column id.
In Column F, write:
=OFFSET(Practices::I$1,MATCH(D&"-"&E, Practices::N,0)−1, 0)
The hyphen in the concatenated representation of the combination of AWG and mils is just tp make it more readable.
As I'm sure you know, you could use other approaches, but since I had you put your aux column at the end of your Practices table, OFFSET with MATCH is a clean approach. INDEX could be used too.
Here's an illustration:
Regards,
Jerry -
Compare two columns and formate based on condition
I know this dead horse has been beaten and I've read my fair share of threads and manuals to no avail.. I have two list that consist of movie titles, holiday movies to be exact. I'm creating a holiday movie schedule which consist of three(3) columns...A,B and C. Column A is the Date, Sat, November 17 2012 thru Monday, Dec 24, 2012. Column C consist of a movie list divided into 2 sections with three subsections each. Section 1 is animated movies and Section 2 is live action, each subsection, 1.1, 1.2, 1.3, 2.1, 2.2 and 2.3 are lists based on popularity with the kids...low, medium and high respectively. And finally column B is the movie list relative the column A...the schedule.
As I write a movie title in column B, I'd like the cell fill to be light red and the corresponding title in column C change to strike through font type. This way I know I've added the movie title to the schedule...this comes in handy when I ask the kids to help so we have no duplicates in the schedule. I'm assuming this would take a combination of; Conditional Formatting, cell formulas and perhaps an additional blank column for trigger results.
I'm including the table, which include an experimental column I was working on. As an FYI, this has been completed in Excel already, just hoping to get it done in Numbers.
Thanks for any help anyone can give.
Date
Movie Name
Class
Sat, Nov 17, 2012
Animated Christmas Movies
TRUE
Lowest Priority Animation
TRUE
Frosty Returns
TRUE
Sun, Nov 18, 2012
The Nightmare Before Christmas
Rudolph and Frosty's Christmas in July
TRUE
Rudolph the Red-Nosed Reindeer & the Island of Misfit Toys
TRUE
Rudolph's Shiny New Year
TRUE
Mon, Nov 19, 2012
Nothing Like the Holidays
TRUE
Medium Priority Animation
TRUE
Jack Frost Animation
TRUE
Tue, Nov 20, 2012
Home for the Holidays
It's Christmas Time Again, Charlie Brown
TRUE
Christmas in South Park
TRUE
Cartoon Network Christmas Rocks
TRUE
Wed, Nov 21, 2012
Planes, Trains and Automobiles
Cartoon Network Christmas Yuletide Follies
TRUE
Cartoon Network Christmas Vol3
TRUE
Twas the Night Before Christmas
TRUE
Thu, Nov 22, 2012
Planes, Trains and Automobiles
The Little Drummer Boy
TRUE
TRUE
Highest Priority Animation
TRUE
Fri, Nov 23, 2012
Trapped in Paradise
The Simpson's Christmas
TRUE
A Very Special Family Guy Freakin' Christmas
TRUE
Family Guy: Road To The North Pole
TRUE
Sat, Nov 24, 2012
American Dad! The Most Adequate Christmas Ever
TRUE
A Charlie Brown Christmas
TRUE
The Nightmare Before Christmas
FALSE
Sun, Nov 25, 2012
Die Hard
Frosty the Snowman
Die Hard 2
Hooves of Fire
How the Grinch Stole Christmas
Mon, Nov 26, 2012
Gremlins
Santa Claus is Comin' to Town
The Year Without a Santa Claus
Rudolph, the Red-Nosed Reindeer
Tue, Nov 27, 2012
The Ice Harvest
Live Action Christmas Movies
Lowest Priority
Wed, Nov 28, 2012
Reindeer Games
National Lampoon's Christmas Vacation 2: Cousin Eddie's Island Adventure
Chasing Christmas
The Nativity Story
Thu, Nov 29, 2012
Bad Santa
Unaccompanied Minors
Jingle All the Way
Jack Frost Live
Fri, Nov 30, 2012
The Shop Around the Corner
The Santa Clause 3: The Escape Clause
The Santa Clause 2: The Mrs. Clause
Sat, Dec 1, 2012
The Bishop's Wife
Medium Priority
0
Bad Santa
Bad Santa
Mixed Nuts
Mixed Nuts
Sun, Dec 2, 2012
The Chronicles of Narnia: The Lion, the Witch and the Wardrobe
Reindeer Games
Reindeer Games
The Ice Harvest
The Ice Harvest
The Shop Around the Corner
The Shop Around the Corner
Mon, Dec 3, 2012
Miracle on 34th Street B&W
The Bishop's Wife
The Bishop's Wife
Christmas in Connecticut
Christmas in Connecticut
The Chronicles of Narnia: The Lion, the Witch and the Wardrobe
The Chronicles of Narnia: The Lion, the Witch and the Wardrobe
Tue, Dec 4, 2012
Mixed Nuts
Nothing Like the Holidays
Nothing Like the Holidays
Home for the Holidays
Home for the Holidays
The Family Man
The Family Man
Wed, Dec 5, 2012
Scrooged
Miracle on 34th Street 1994
Miracle on 34th Street 1994
Miracle on 34th Street B&W
Miracle on 34th Street B&W
Just Friends
Just Friends
Thu, Dec 6, 2012
Just Friends
Trapped in Paradise
Trapped in Paradise
0
Highest Priority
0
Fri, Dec 7, 2012
Miracle on 34th Street 1994
Die Hard
Die Hard
Die Hard 2
Die Hard 2
Gremlins
Gremlins
Sat, Dec 8, 2012Hi Stephen,
Both of these are solvable, and the Date solution cold be similar to that used for the 'stock list' in column C. The Movie Title solution is a different case, though.
The stock list is edited only occasionally, so requiring the user to unhide column C, add a title, then rehide the column is workable.
The same is true of the date list, so this too would work with the dates entered into a column that will be hidden, then copied into a visible column with a formula that introduced a detectable difference into the copied version, dependent on the weekday of each date. That difference would be used to trigger the conditional formatting of the cell containing the calculated date as text value. See the example below.
But the (scheduled) Movie Title column doesn't fit nicely into that mode of operation, as it is edited quite often. As editing, usng the model described, requires making the data column visible, editing the entry (or entries) in that column, then rehiding the column, the hassle factor soon becomes insufferable, if nothing else.
The first solution I considered (see earlier reply) is workable only if the the formatted table starts and remains the same size in all details (ie. individual row height) as the main table.Any change in row height in the main table not reflected in the auxiliary table immediately destroys the impression of formatting applying to the correct cells. With cells set to wrap text and varying lengths of movie titles, wrapped lines changing the height of individual rows is pretty much unavoidable.
Best practice here would seem to be to use a separate column to flag the titles already in the "Class" list with a "√" (or flag those not in the list with an "X"), and use conditional formatting to change the background colour of the flagging cell.
Here's a sample, using "W" to flag the weekend dates in the new column B, and "√" to flag the titles that are on the list already in the new column D.
I've added two titles to the weekend date, November 18. One is non-existent (as far as I know), so it doesn't appear in the list and doesn't get flagged; the other is chosen from a visible part of the list to show the highlighting of the title in that list. Column "C" (now column "F" due to the insertion of two new columns) is hidden. G, labelled .Class, is the calculated column (D) from the previous message.
Regards,
Barry -
How do I compare two columns of data in Numbers to find the unique results?
Hello all,
I'm looking for a way to compare the data from two columns so I can find the unique results and display that data in a third column. To be specific, here's what I'm doing.
Column A is a list of email addresses for people I have already written. Column B is a list of email addresses for people I would like to contact. I am not sure if there are email address from Column A in Column B, but there may be and if there are, I must find out so that I don't send a second email to these recipients. How can I have Numbers look at both columns and tell me which email addresses in Column B are not in Column A?
Thanks for the help!!!gfmp123,
Here's an alternate use of MATCH to find duplicates. I hope you find one of the two solutions, Wayne's or this one, useful for your case.
The expression in Column C is:
=IFERROR("Dup in Row "&MATCH(B, A,0), "")
Regards,
Jerry -
SharePoint Calc Column - How to Find and Replace ANY & ALL Values with Something Else
Haven't found a solution on this even though it seems like it should be cut and dry.
I have a column containing characters "-" (e.g., XXX123-123-fjhrh-sdafsdfsd). I want to find every "-" and replace it with "@". Seems easy but so far haven't found a solution. My calc column always seems to stop at the first
occurence of "-" and only replace that one. Seems every forumula wants you to tell SharePoint where to start (position). You can't simply tell SharePoint, Find this "-" ALL OCCURENCES and replace with this "@" ALL OCCURENCES.
I don't have the option of saying start at this position because my data is not the same in every cell/field (e.g., number of characters).
Closest I've gotten is this:
=REPLACE([IN THIS COLUMN],FIND("-",[IN THIS COLUMN]),LEN("-","@")
RESULTS:
XXX@123-XXX-123Hi JJSHAREP,
The formula only works when there are only three "-" in the column value, and the formula will fail if there are more than or less than three "-" in the column value.
I recommend to use Jquery code to replace the characters in the column called IN THIS COLUMN in the UI:
<script src="http://code.jquery.com/jquery-1.10.2.min.js" type="text/javascript"></script>
<script type="text/javascript">
$(function () {
var Index=0;
$(".ms-listviewtable tr th").each(function(i){
if($(this).find("div").attr("name")=="IN_x0020_THIS_x0020_COLUMN"){
Index=i;
$(".ms-listviewtable tr").each(function(i){
if(i>0){
var value=$(this).find("td").eq(Index).text();
var value1=value.replace(/\-/g, '@');
$(this).find("td").eq(titleIndex).text(value1);
</script>
Best regards.
Thanks
TechNet Community Support
Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact
[email protected] -
Compare two tables and log the difference
Hi,
I want to compare two tables and log the difference in new table with the fields as (old value,new value, column name). The column name should be the changes value columnCan you show an example?
SELECT Foo.*, Bar.*
FROM Foo
FULL OUTER JOIN
Bar
ON Foo.c1 = Bar.c1
AND Foo.c2 = Bar.c2
AND Foo.cn = Bar.cn
WHERE Foo.key IS NULL
OR Bar.key IS NULL;
Best Regards,Uri Dimant SQL Server MVP,
http://sqlblog.com/blogs/uri_dimant/
MS SQL optimization: MS SQL Development and Optimization
MS SQL Consulting:
Large scale of database and data cleansing
Remote DBA Services:
Improves MS SQL Database Performance
SQL Server Integration Services:
Business Intelligence -
Create ViewCriteria comparing two columns from same table
Does anyone know how I can create a ViewCriteria where clause that compares two columns from the same table?
For example if I had two integer columns (MINSAL and MAXSAL) and wanted to see if they are equal. I would normally do the following SQL below.
SELECT * FROM EMPL
WHERE MINSAL = MAXSALIt works, but it is not ideal.
Setup a Transient column that performs a groovy evaluation of MINSAL=MAXSAL and then my ViewCriteria evaluates the column to true and I set Query Execution Mode to Both. -
Need to compare values in two columns of one table against values in two columns in another table
Hi, as the title reads, I'm looking for an approach that will allow me to compare values in two columns of one table against values in two columns in another table.
Say, for instance, here are my tables:
Table1:
Server,Login
ABCDEF,JOHN
ABCDEF,JANE
FEDCBA,SEAN
FEDCBA,SHAWN
Table2:
Server,Login
ABCDEF,JOHN
ABCDEF,JANE
FEDCBA,SHAWN
In comparing the two tables, I'd like my query to report the rows in table1 NOT found in table2. In this case, it'll be the 3rd row of table one:
Server,Login
FEDCBA,SEAN
Thanks.create table Table1([Server] varchar(50), Login varchar(50))
Insert into Table1 values ('ABCDEF','JOHN'),('ABCDEF','JANE'),('FEDCBA','SEAN'),('FEDCBA','SHAWN')
create table Table2([Server] varchar(50), Login varchar(50))
Insert into Table2 values ('ABCDEF','JOHN'),('ABCDEF','JANE'), ('FEDCBA','SHAWN')
select [Server] ,Login from Table1
Except
select [Server] ,Login from Table2
select [Server] ,Login from Table1 t1
where not exists(Select 1 from Table2 where t1.[Server] = t1.[Server] AND Login=t1.Login)
drop table Table1,Table2 -
Comparing two dates and adding days to date
Hi,
I want to compare two dates(like 2006/10/21 and 2006/11/2),how can i compare these two dates,like which is greater.And if to the second date,i want to add some number of days like 10 days,how can i add so that the date becomes 2006/11/12).
Please reply soon.ThanksNo,all other queries are different,as they have the
date in this format
'2006-03-06 " but i have the date in this format
"2006-03-06 10:26:46.0",
i.e the time is also assciated with it.
If I have only the date(in string format or date
date format 2000/12/1),then I can easily do it,but
I have the time also.If I have the date only,then I
can split the date into three strings,and after
converting into integer I can pass it to the
constructor,but what about the time?SimpleDateFormat can parse "2006-03-06 10:26:46.0" date too:
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss.SS");
Date date = dateFormat.parse("2006-03-06 10:26:46.0");
System.out.println("date = " +date); -
Check two columns and update other table
HI ,
I have a table called trackCenterline .Below is the table.
What i want to do is If the segmentSequenceID is 1 it should pick the corresponding SegmentID i.e 10001 and Check for the same segment id in other table called TrackSegment which is below. and pick the BeginMilepost of that segmentID and Update That
Milepost in a new table .At end SegmentSequenceID number it should pick ENDMilepost and update
TrackCenterline table.
TrackSegment table
In the below table for 10001 SegmentID it should pick BeginMilepost. For end Number of SegmentSequenceID in above table ID ends at 121 for that end sequenceID It should refer TrackSegment table below and pick EndMilepost and should be updated in another
table Milepost column.
after that a new segment starts with new sequence .and so on ...
bhavanaHi Deepa_Deepu,
According to your description, since the issue regards T-SQL. I will help you move the question in the T-SQL forums at
http://social.technet.microsoft.com/Forums/en-US/home?forum=transactsql. It is appropriate and more experts will assist you.
When you want to check two columns from two tables then return some results and update the third table. I recommend you use join function and combine two tables, then use update select from statement for modifying the Mailpost table. You can refer to the
following T-SQL Statement.
-----using join to connect to two tables
select TrackCenterline.FeatureId,TrackCenterline.SegmentId,
TrackCenterline.SegmentSequenceId,TrackSegment.BeginMilepost,TrackSegment.EndMilepost
from dbo.TrackCenterline join dbo.TrackSegment
on TrackCenterline.SegmentId=TrackSegment.SegmentId
order by TrackCenterline.SegmentId, TrackCenterline.SegmentSequenceId
---the result shows as following.
FeatureId SegmentId SegmentSequenceId BeginMilepost EndMilepost
AMK100011 10001 1 61.0000 61.3740
AMK100012 10001 2 61.0000 61.3740
AMK100013 10001 3 61.0000 61.3740
AMK1000121 10001 121 61.0000 61.3740
AMK100021 10002 1 61.1260 61.7240
AMK100023 10002 3 61.1260 61.7240
AMK100033 10003 3 61.3740 62.9530
-----Then you can use update select from statement to modify the Mailpost table, Or you can post the table structure of Mailpost
And for more information, you can review the following article about update statement.
http://www.techonthenet.com/sql/update.php
Regards,
Sofiya Li
Sofiya Li
TechNet Community Support -
Used to be able to pick out which songs in iTunes in my computer were not on a 2nd computer on homeshare in iTunes 10. Now with V11, cant find the button that compares two libraries and finds the songs that are different. Anyone know how to do this now?
Jneklason wrote:
~snip~
I know this email is confusing and really hard to understand...perhaps now you will know how i've been feeling--lost and confused with all the mis-information, with a hit and miss phone, and out of time with all the 1 1/2 hr to 2 hrs EACH wasted on this issue.
On top of all this, I can't even find out how to file a complaint with anyone higher up than Customer Service.
I hate to tell you this, but you didn't write an email. You wrote a discussion post on the Verizon Wireless Community forum which is a public peer to peer forum. Unfortunately since you didn't mark your post as a question, the VZW reps that roam this community won't ever see your post. Before you re-post it, don't. Duplicate posts get removed from the community.
I see there were several missteps both by the reps and yourself in your post. First you should have insisted on returning the phone within the 14 day return policy period. Second which Samsung Galaxy mini model did you purchase? The S3 mini or the S4 mini? Did you do any research prior to deciding on this device. The reps at that time deflected the easiest course of action, by trying to get you to replace the phone under insurance instead of returning the phone. The Early Edge payment option requires the current phone on the line using the early Edge must be returned to Verizon Wireless. Did you once considered going to a third party site like Swappa to purchase a gently used device for your daughter? -
I Had to reinstall windows on my computer. I made sure all my songs etc were on my iPods/iPad. Now when I plug the iPod in it says (in iTunes Match) that my music library will be deleted and replaced by what is in the cloud. However I don't want those songs erased. I want them to go up to the I tunes match cloud.
so that I can down load them again.
also how do I get I tunes match to remember my playlists? It only has album etc.
thank you so very much. I appreciate any help.See Recover your iTunes library from your iPod or iOS device.
tt2 -
I want to compare two programs ....
actually i have a requirement where in i have to compare two programs and have to sight the difference line by line....
so guys please help me out with this ....is their any tool which will solve the problem for me
thanks in advance
rajeevhi Rajeev,
SE39 allows you to compare 2 programs.
if u find it useful mark the points
~~guduri
Maybe you are looking for
-
MBP Compared to a G4 iMac?
There's lots of ruminating about the speed issues of non-universal applications on the MBP. I'm moving from a 17" iMac 700 to the 17" MBP. What can expect performance-wise with the main Adobe apps with ths kind of hardware change? Plus it will allow
-
How to create STPR(Stock Trasnsfer Pruchase Req) in MRP Run
Hello PP Guru , I am running MRP in various branch-plant .I maintained Special Procurement Key 40 for all the material in branch-plant .Here we have one supply plant .We run MRP at Supply plant once all our other branches(plant) completes their MRP
-
How can burst mode be disabled in iOS 7?
Since upgrading, each time I've used the on-screen shutter button I end up with a pile of burst mode shots. It was WAY more convenient to hold the shutter button and have it take the shot upon release. This way you could frame and focus, then shoot.
-
Intgration of crystal reports in Apex
Hi, I want integrate crystal reports with apex. Could any body tell me , is it possible ?
-
Repeated area and javascript function
Hello every body, I have a problem and I can't find the solution, but I am sure it is solvable ! my page is a PHP page, I work with Dreamweavere 8 I have a catalog list which presents global product reference based on article designation for instance