Thanks:  0
Likes:  0
Dislikes:  0

# Thread: get the count

1. ## get the count

hi,
I need help in counting the number of entries in a cell-1(Cell-1: row 1,column 1) of an excelsheet, and then compare the count with another cell-2 (cell-2: row 1,column 2)entries in the same worksheet. If it matches i am executing some statements. And if cell-2 has an extra entry or a less entry compared to cell-1, then i need to display that missing/extra entry.
Can anybody help me on this

2. ## Re: get the count

By "number of entries" do you mean the value in the cell?

Mark Smith.

3. ## Re: get the count

by nymber of entries i mean...for example:
cell-1(Cell-1: row 1,column 1) has entries A,B,C,D and cell-2 (cell-2: row 1,column 2)has A,B,C,D,E.
the A,B,C,D can be any numeric also like 12,34,56 in cell-1
and 12,34,56,78 in cell-2

4. ## Re: get the count

if the entries in both cells are separated by comas then count the number of comas in each cell

Function CompareValuesInCell(valueInCell1, valueInCell2)
Dim counter1, counter2
counter1 = 0
counter2 = 0
For i = 0 to len(ValueInCell1)
If strComp(Mid(ValueInCell1,i+ 1,1),",") = 0 Then
counter1 = counter1 + 1
End If
Next
For i = 0 to len(ValueInCell2)
If strComp(Mid(ValueInCell2,i+ 1,1),",") = 0 Then
counter2 = counter2 + 1
End If
Next
If counter1 = counter2 Then
'return true or execute the function u want to execute
CompareValuesInCell = True
End If
End Function

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•
Search Engine Optimisation provided by DragonByte SEO v2.0.36 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Resources saved on this page: MySQL 11.11%
vBulletin Optimisation provided by vB Optimise v2.6.4 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
User Alert System provided by Advanced User Tagging v3.2.8 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
vBNominate (Lite) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Feedback Buttons provided by Advanced Post Thanks / Like (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Username Changing provided by Username Change (Free) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
BetaSoft Inc.
Digital Point modules: Sphinx-based search
All times are GMT -8. The time now is 09:51 AM.