Link to home
Start Free TrialLog in
Avatar of bsharath
bsharathFlag for India

asked on

Excel sheet sorting

Hi,

I have a excel which has this data

Computername            Software      Software              Software
Dev-chen-mrd100     Citrix                   MS Office          Magic
Dev-chen-nas01        Msoffice             Magic             Citrix
Dev-chen-srv400      Magic                 Citrix                     Nero
Dev-chen-srv401       Nero                 Citrix                     Ie 7.0

I have the above data in the excel.What i want is all the ms office to come to one colum and all the Magic in one colum and if any software is not found in another row then leave the box empty.


Regards
Sharath
Avatar of byundt
byundt
Flag of United States of America image

Sharath,
Here are two formulas to consider if you have a list of software titles in B1:Z1
=IF(Sheet1!A2="","",Sheet1!A2)                  for cell A2         Copies the computer name over from Sheet1
=IF(SUMPRODUCT((Sheet1!$A$2:$A$1000=$A2)*(Sheet1!$B$2:$Z$1000=B$1))>0,B$1,"")          for cell B2     Returns software name or an empty string

You may copy these formulas down and across as needed

Brad
Avatar of bsharath

ASKER

byundt

Any way with a macro.

If not then i shall say what i have understood
At the end of each row
=IF(Sheet1!A2="","",Sheet1!A2)
On the next row this
=IF(SUMPRODUCT((Sheet1!$A$2:$A$1000=$A2)*(Sheet1!$B$2:$Z$1000=B$1))>0,B$1,"")

In the last column write this formula then copy down (copy by dragging down)
=IF(COUNTIF(F18:H18,"Magic"), "Magic found", "")
where F18:H18 is the range (e.g F18 citrix, G18 msoffice, H18 magic)

Hope this helps.
If you want to list the name of the computer on which the software exists then
=IF(COUNTIF(F18:H18,"Magic"), E18, "")
where E18 in the cell which has the computer name (e.g. Dev-chen-mrd100)
write the formula in cell I18, considering that Dev-chen-mrd100 is in cell E18
Sharath,
The two formulas I posted were intended for cells A2 and B2. The formula for A2 may be copied down. The formula for B2 should be copied across and down. Since the formulas return empty strings (looks like a blank) when there are no more data, you can copy them down indefinitely (thereby preparing for more data to be added in the future).

The reference to row 1000 was arbitrary, and may extend beyond your last data; doing so allows you to add data in the future.

Brad
'this macro will populate all magic softwares in column 2 and ms office in column 3
Sub agroup()

For i=2 to Sheet1.UsedRange.Rows.Count
     For j=2 to 4
         if UCase(Sheet1.Cells(i,j)) ="MAGIC" then
              if j<> 2 then
                      temp = Sheet1.Cells(i,2)
                      Sheet1.Cells(i,2) = "Magic"
                      Sheet1.Cells(i,j) = temp
              End if
         End if
         if UCase(Sheet1.Cells(i,j)) ="MS OFFICE" then
              if j<> 3 then
                      temp = Sheet1.Cells(i,3)
                      Sheet1.Cells(i,3) = "MS Office"
                      Sheet1.Cells(i,j) = temp
              End if
         End if
    Next
Next
End Sub
ASKER CERTIFIED SOLUTION
Avatar of jeverist
jeverist
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial