Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
How do i comapre 2 columns
a formula can't do that unless the values in column B a produced by a
formula =if(A1="C",-25,Current formula for B) or in column C you could put in C1 =if(A1="C",-25,B1) then drag fill this down your column. Then select the cells in C, do Edit=Copy, then select B1 and do Edit=Pastespecial and select Values. for code Sub ReplaceValuesInB() range(B1").Select do if activeCell.offset(0,-1).Value = "C" then activeCell.Value = -25 End if activeCell.offset(1,0).Select loop while not isempty(activeCell) End Sub test any of these on a copy of your data. -- Regards, Tom Ogilvy "Leo" wrote in message ... HI Prods I have situation here. I have a column A and B A B D 25 C 23 D 45 C 56 D 34 Ineed to write a formula to compare these columns for the condition if the cloumn A has the value C the the corresponding value in column B should become -25. How do i do this please let me know about it. Thanks Diwakar |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Match data then comapre and return new data | Excel Worksheet Functions | |||
Macro for comapre and copy | Excel Discussion (Misc queries) | |||
comapre two list of data & arranging in a same manner | New Users to Excel | |||
Combine multiple columns into two long columns, Repeating rows in first column | Excel Discussion (Misc queries) | |||
comapre two lists | Excel Discussion (Misc queries) |