• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

offsetting a positive value with a negative value in a column

yasir

New Member
Dear all,

I am taking much time to offset manually the values in a column. I wanted to separate the values which is not offsetting in the column. for example

a

10

-10

20

-20

30


in above example i wanted to separate the 30 using any formula because it is not offsetting with another same value. Please assist if any body knows.
 
In helper column:

=IF(ISNUMBER(MATCH(-A2,A:A,0)),"corresponding value found","NO MATCH")
 
You can use conditional formatting with the follwing formula, assuming the data is in the range B6:B30, you can format as required, to highlight the non-matching cells.


=COUNTIF($B$6:$B$30,B6*-1)=0
 
Luke..thanks for ur answer but it is not working if repeated values occurs..


10-

10

20-

20

10

30

in above case i have to separate the 10 & 30. here in your formula the 10 is showing matched but it is not offsetting.
 
Corrected formula for repeat values (starting value is in A2):

=IF(COUNTIF(A:A,-A2)<COUNTIF($A$2:A2,A2),"No match","")
 
Last edited:
sure thing xcruc1at3r.

In layman terms, the formula wants to know if there are more entries to date of the same-sign value then there are total entries of the opposite-signed value. This would indicate the that entry does not have a match.


So, the formula does a COUNTIF of the entire range looking for the opposite sign, and compares it to a COUNTIF using a growing range (uses a combined absolute-relative reference) looking for same sign.


If the criteria is met, we flag it with some words, otherwise, leave blank.
 
Corrected formula for repeat values (starting value is in A2):

=IF(COUNTIF(A:A,-A2)&#60;COUNTIF($A$2:A2,A2),"No match","")

I'm trying this...

=if(countif(i:I,-i2)&#60:countif($i$2:i2,i2),"no match","")

but it errors on the #60. What is that #60 for?
 
I'm trying this...

=if(countif(i:I,-i2)&#60:countif($i$2:i2,i2),"no match","")

but it errors on the #60. What is that #60 for?

I noticed I had a colon after the #60 so I changed it...

=if(countif(i:I,-i2)&#60;countif($i$2:i2,i2),"no match","")

I still get an error. And I don't know what the &#60 is for?

-Thanks, Ron M.
 
I noticed I had a colon after the #60 so I changed it...

=if(countif(i:I,-i2)&#60;countif($i$2:i2,i2),"no match","")

I still get an error. And I don't know what the &#60 is for?

-Thanks, Ron M.

OMG...

the &#60 is "<" (less than)

So I used...

=IF(COUNTIF(I:I,-I2)<COUNTIF($I$2:I1960,I2),"no match","")

But...

its marking the positive value with a "no match", but there is a negative match? The negative match isn't marked? it's odd...
 
Hi Ron ,

Is the address in your posted formula a typo here or is it there in the worksheet as well ?

=IF(COUNTIF(I:I,-I2)<COUNTIF($I$2:I1960,I2),"no match","")

Narayan
 
(Side note)
When the forum got migrated in 2013, several symbols (such as the < and > symbols) got messed up. As I stumble across old threads, I try to fix them. I'll go through this thread and correct those mistakes, sorry for the confusion this caused you ronmaltase. :(
 
Back
Top