Author Topic: Where can I get some Excel help?  (Read 1486 times)

0 Members and 1 Guest are viewing this topic.

Offline manfaux

  • Thread Starter
  • Posts: 584
Where can I get some Excel help?
« on: Thu, 08 December 2011, 11:45:16 »
hi fellow Geekhackers,

i recently ran into a simple problem with an Excel project, the solution should be incredibly simple but I just can't seem to find anywhere on the 'net. Browsed through all those MS office forums for hours and no help.

simply put, I need to merge the data from two columns in Excel into one column, with lots of cells missing in each column, so i'm combining something like this:


Column A            
 "empty cell"                
Geekhacker Dave          
Geekhacker Glenn        
"empty cell"                
"empty cell"                



Column B
Geekhacker Scott
"empty cell"
Geekhacker Nick
Geekhacker Heather
Geekhacker Shannon

                 

and the end result I desire is this:

Geekhacker Scott
Geekhacker Dave
Geekhacker Glenn
Geekhacker Nick
Geekhacker Heather
Geekhacker Shannon



so essentially just filling it the blank cells in column A with the content of column B, or vice versa, and in the case where there are data on the same row in both columns like Geekhacker Glenn and Nick , just move Nick one cell down and keep going with the process.

If anyone could point me in the right direction or just provide some good online help source forum and whatnot I'd appreciate it tremendously.

and yes I have coding experience and know Excel macros!

thanks Geekhackers!
« Last Edit: Thu, 08 December 2011, 11:52:41 by manfaux »

Offline manfaux

  • Thread Starter
  • Posts: 584
Where can I get some Excel help?
« Reply #1 on: Thu, 08 December 2011, 11:53:20 »
wtf can't edit post in Chrome? fixed some formatting.

Offline Dox

  • Posts: 312
Where can I get some Excel help?
« Reply #2 on: Thu, 08 December 2011, 17:10:36 »
Could you just paste the first list at the end of the second list and sort that complete list. That would put all the empty cells together at the end or beginning depending on how you sort.
ErgoDox x2 | DoxKB x2 |   IBM SSK   | HHKB pro2

Offline alaricljs

  • I be WOT'ing all day...
  • ** Moderator Emeritus
  • Posts: 3715
  • Location: NE US
Where can I get some Excel help?
« Reply #3 on: Thu, 08 December 2011, 19:26:39 »
If you have a ton of fields in the other columns, just sort on one of the columns that has empties, then hilight just the cells that are full and move it to the other column.  Then re-sort as needed.
Filco w/ Imsto thick PBT
Ducky 1087XM PCB+Plate, w/ Matias "Quiet Click" spring-swapped w/ XM Greens

Offline xsmiggax

  • Posts: 3
Where can I get some Excel help?
« Reply #4 on: Tue, 13 December 2011, 08:03:17 »
In column c

=IF(a1<>"",a1,b1)

drag down

Offline transcend3nt

  • Posts: 81
Where can I get some Excel help?
« Reply #5 on: Wed, 14 December 2011, 02:01:52 »
I dont know if you've solved it,

1. Copy column B and column A into a new column and advance sort by unique values

2. Excel macros do whatever you want. Just do a loop, if cell Ax and Bx are NOT empty, just add two entries into two new rows. Note that your counter will always do the job of the count incremental so you'll definitely won't get any lapses.

e.g.

dim increment as integer
increment = 0


loop **** from 1 to X 'where X is the maximum row count which column A/B has

  if A(count) <> "" and B(count) <> "" then  
     C(count) = A(count)
     increment++;
     C(count+increment) = B(count)
  else
     // take either A or B
  endif

count++
end loop

Offline manfaux

  • Thread Starter
  • Posts: 584
Where can I get some Excel help?
« Reply #6 on: Wed, 14 December 2011, 15:10:36 »
LOL WTF I can't reply in my browser for some mysterious reason, doing it on a different pc now.

thanks to all the replies I'm trying each one of the solutions you provided. BRB.

Offline FrancSutherland

  • Posts: 1
Where can I get some Excel help?
« Reply #7 on: Thu, 15 December 2011, 07:33:31 »
Sounds like you could use the concatenate function

In the result cell enter the formula, =concatenate(cell1, cell2)

If you need more Excel help, I have a load of spreadsheet help at my company's website, workingdata.co.uk

Hope this helps,

Franc.

Offline xsmiggax

  • Posts: 3
Where can I get some Excel help?
« Reply #8 on: Thu, 15 December 2011, 10:20:50 »
I didn't read the bit about there being conflicting names in the same row in the different columns. If you only have to do it once use the sort method above. If its a regular thing I'll type you the macro required when I'm not using a phone to post!

Offline manfaux

  • Thread Starter
  • Posts: 584
Where can I get some Excel help?
« Reply #9 on: Thu, 15 December 2011, 10:54:01 »
Quote from: xsmiggax;471378
I didn't read the bit about there being conflicting names in the same row in the different columns. If you only have to do it once use the sort method above. If its a regular thing I'll type you the macro required when I'm not using a phone to post!


perhaps asking a fellow gher to type the macro for me is asking little too much, but I'd be grateful just to see roughly how you would implement it.

and yes the conflicting names in the same row is a normal thing, happens once every five of six rows!

Offline manfaux

  • Thread Starter
  • Posts: 584
Where can I get some Excel help?
« Reply #10 on: Thu, 15 December 2011, 10:55:39 »
Quote from: FrancSutherland;471249
Sounds like you could use the concatenate function

In the result cell enter the formula, =concatenate(cell1, cell2)

If you need more Excel help, I have a load of spreadsheet help at my company's website, workingdata.co.uk

Hope this helps,

Franc.

thanks for the site, but the concatenate function doesnt do what i described at all.

Offline manfaux

  • Thread Starter
  • Posts: 584
Where can I get some Excel help?
« Reply #11 on: Thu, 15 December 2011, 10:59:29 »
Quote from: Dox;466717
Could you just paste the first list at the end of the second list and sort that complete list. That would put all the empty cells together at the end or beginning depending on how you sort.

the problem with that is, for each cell, there is no way of keeping track of their order in the original columns!

Offline manfaux

  • Thread Starter
  • Posts: 584
Where can I get some Excel help?
« Reply #12 on: Thu, 15 December 2011, 11:08:46 »
simply put, in the case where there's a conflict, say column A has data AAAAA, column B has data BBBBB, my desired result column should be in the format of ABABABABAB.

Offline xsmiggax

  • Posts: 3
Where can I get some Excel help?
« Reply #13 on: Thu, 15 December 2011, 14:50:24 »
Code: [Select]
Sub geekhack()

x = 1
y = 1

Do Until x = 10

ColAVal = Sheet1.Range(&quot;A&quot; & x).Value
ColBVal = Sheet1.Range(&quot;B&quot; & x).Value


    If ColAVal = &quot;&quot; And ColBVal <> &quot;&quot; Then

        Sheet1.Range(&quot;C&quot; & y).Value = ColBVal
   
    ElseIf ColAVal <> &quot;&quot; And ColBVal = &quot;&quot; Then

        Sheet1.Range(&quot;C&quot; & y).Value = ColAVal
   
    ElseIf ColAVal = &quot;&quot; And ColBVal = &quot;&quot; Then
   
    ElseIf ColAVal = ColBVal Then
   
        Sheet1.Range(&quot;C&quot; & y).Value = ColAVal
   
    ElseIf ColAVal <> ColBVal Then
   
        Sheet1.Range(&quot;C&quot; & y).Value = ColAVal
        Sheet1.Range(&quot;C&quot; & y + 1).Value = ColBVal
   
        y = y + 1

    End If

x = x + 1
y = y + 1

Loop

End Sub