Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 13
Default how to compare 2 cells in range

Hi, sorry for my English :)

My data:

plan | done
100 | 0
100 | 100
200 | 150
100 | 100
..... .... hundreds equal cells

Is any formula, which gives me result=2 ?

I don't want (i can't) to add new column with, for example, =a2=b2 and then
count false.

I want only count of false.

I hope my post is clear :)


tomekgomek

  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
bj bj is offline
external usenet poster
 
Posts: 1,397
Default how to compare 2 cells in range

=sumproduct(--(A1:A100<B1:B100))
will count the number of non equal pairs in rowns 1-100 in columns a and B
note you cannot use A:A<B:B in sumproduct
the--( chnages the logical true false to a numeric 1 0

"tomek gomek" wrote:

Hi, sorry for my English :)

My data:

plan | done
100 | 0
100 | 100
200 | 150
100 | 100
..... .... hundreds equal cells

Is any formula, which gives me result=2 ?

I don't want (i can't) to add new column with, for example, =a2=b2 and then
count false.

I want only count of false.

I hope my post is clear :)


tomekgomek


  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 11,501
Default how to compare 2 cells in range

With your data in column A and B, with a macro:-

Sub strata()
Dim i As Integer
i = Range("A1").CurrentRegion.Rows.Count
Set myrange = Range("A1:A" & i)
For Each c In myrange
If c.Value < c.Offset(0, 1).Value Then Count = Count + 1
Next
MsgBox (Count & " difference between column A & B")
Cells(1, 3).Value = Count
End Sub

Right click sheet tab view code and paste in

Mike

"tomek gomek" wrote:

Hi, sorry for my English :)

My data:

plan | done
100 | 0
100 | 100
200 | 150
100 | 100
..... .... hundreds equal cells

Is any formula, which gives me result=2 ?

I don't want (i can't) to add new column with, for example, =a2=b2 and then
count false.

I want only count of false.

I hope my post is clear :)


tomekgomek


  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 13
Default how to compare 2 cells in range


Użytkownik "Mike H" napisał w wiadomości
...
With your data in column A and B, with a macro:-

Sub strata()
Dim i As Integer
i = Range("A1").CurrentRegion.Rows.Count
Set myrange = Range("A1:A" & i)
For Each c In myrange
If c.Value < c.Offset(0, 1).Value Then Count = Count + 1
Next
MsgBox (Count & " difference between column A & B")
Cells(1, 3).Value = Count
End Sub

Right click sheet tab view code and paste in

Mike


thanks, but VBA isn't for my boss :) anyway, thanks

tomekgomek

  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 13
Default how to compare 2 cells in range


Użytkownik "bj" napisał w wiadomości
...
=sumproduct(--(A1:A100<B1:B100))
will count the number of non equal pairs in rowns 1-100 in columns a and B
note you cannot use A:A<B:B in sumproduct
the--( chnages the logical true false to a numeric 1 0


great, super, wow :)
thanks

tomek

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
compare the contents of one range of cells with the contents of a. Dozy123 Excel Discussion (Misc queries) 1 January 24th 07 10:14 AM
Look-up and Compare Table Range Then Jay Excel Worksheet Functions 1 August 30th 06 06:21 AM
compare cell with a range bagus Excel Discussion (Misc queries) 6 June 13th 06 12:57 PM
How do I compare cells and if FALSE compare to next cell in EXCEL Cindie Excel Worksheet Functions 0 March 24th 06 05:29 PM
Compare range with another range in other workbook Arjan Excel Worksheet Functions 2 November 15th 05 03:31 PM


All times are GMT +1. The time now is 02:04 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"