Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / New Users / April 2007

Tip: Looking for answers? Try searching our database.

if statement help

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Adam - 23 Apr 2007 02:30 GMT
Looks like this

Adam        1
Smith         2
Johns         6
adam         3
smith          4
johns            7

What i would like to do is if
Adam matches another adam in list then it adds the 2 together
so in this case adam would = 4
Dave Peterson - 23 Apr 2007 15:04 GMT
Maybe you can add headers to your data
Then sort that data by the Name
and do Data|Subtotals

And hide the details using the outlining symbols at the left.

===
You may want to spend some time learning about data|pivottable, too.

> Looks like this
>
[quoted text clipped - 8 lines]
> Adam matches another adam in list then it adds the 2 together
> so in this case adam would = 4

Signature

Dave Peterson

Adam - 26 Apr 2007 04:30 GMT
thanks
> Maybe you can add headers to your data
> Then sort that data by the Name
[quoted text clipped - 17 lines]
>> Adam matches another adam in list then it adds the 2 together
>> so in this case adam would = 4
Billy Liddel - 23 Apr 2007 15:26 GMT
or you could use something like this

=SUMPRODUCT(--(UPPER($A$2:$A$7)=UPPER(A2))*$B$2:$B$7)

If you wanted to get a list of unique names and do not mind using a macro
try this

Sub UniqueList2()
'place activecell in list
Cells(1, 2).Select
addr = ActiveCell.Address
Set rng = Application.InputBox("Enter the range", "DataRange", addr, 100,
100, , , 8)
' details for unique list range
r = ActiveCell.Row: startR = r
'enter results in blank columns
col = ActiveCell.CurrentRegion.Columns.count + 2
'loop
For Each c In rng
 Set lst = Range(Cells(startR, col), Cells(r, col))
 x = Application.Match(c, lst, 0)
   If IsError(x) Then
       Cells(r, col) = c
       r = r + 1
   End If
Next
End Sub

But Daves, Subtotals idea is good.

Regards
Peter

Rate this thread:






 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.