1. Welcome! Please take a few seconds to create your free account to post threads, make some friends, remove a few ads while surfing and much more. ClutchFans has been bringing fans together to talk Houston Sports since 1996. Join us!

Excel question

Discussion in 'BBS Hangout' started by Haymitch, Jul 17, 2014.

  1. Haymitch

    Haymitch Custom Title

    Joined:
    Dec 22, 2005
    Messages:
    28,371
    Likes Received:
    24,021
    Probably very easy, but:

    If cell A5 or B5 are not blank, copy value from C5 into D5.
     
  2. Haymitch

    Haymitch Custom Title

    Joined:
    Dec 22, 2005
    Messages:
    28,371
    Likes Received:
    24,021
    So what I really want is a formula to make table 2 from table 1.

    If there is something in columns Value or Value 2, I want the something(s) and the(ir) corresponding date(s) to be carried over.

    [​IMG]
     
  3. cheke64

    cheke64 Member

    Joined:
    May 12, 2009
    Messages:
    25,912
    Likes Received:
    17,932
    I read your bet sig. Did you get laid off?
     
  4. heypartner

    heypartner Member

    Joined:
    Oct 27, 1999
    Messages:
    63,517
    Likes Received:
    59,021
    You don't need a formula, just use Data Filters. Why not just create a filter for the two value columns. filter both columns by anything non blank That is: select all values then uncheck the blanks filter

    Now cut n paste what is left as Table 2
     
  5. Pete the Cheat

    Joined:
    Jun 30, 2006
    Messages:
    3,100
    Likes Received:
    487
    use two seperate sumif formulas for your columns in table 2
     
  6. tallanvor

    tallanvor Member

    Joined:
    Oct 9, 2007
    Messages:
    18,773
    Likes Received:
    11,961
    made u a macro:

    sub foo

    for each cell in Range(Cells(topRow, 1),Cells(bottomRow, 1))
    if cell = "" or Cells(cell.row, 2) = "" then
    Cells(cell.Row, 4) = Cells(cell.Row, 3)
    end if
    next cell

    end sub
     
  7. JuanValdez

    JuanValdez Member

    Joined:
    Feb 14, 1999
    Messages:
    35,103
    Likes Received:
    15,314
    in D5, write "=IF(AND(A5="",B5=""),"",C5)

    In other words, if A5 and B5 are both blank, then blank, otherwise C5. So, if either A5 or B5 is not blank, then C5 will show.

    I think.
     
  8. heypartner

    heypartner Member

    Joined:
    Oct 27, 1999
    Messages:
    63,517
    Likes Received:
    59,021
    I think you misread the problem, because that macro won't work on so many levels

    He's creating a new table from an original. And he wants to delete empty rows

    He just needs to use the Data Filter feature
     
  9. heypartner

    heypartner Member

    Joined:
    Oct 27, 1999
    Messages:
    63,517
    Likes Received:
    59,021
    He wants to delete empty rows. That won't do it.
     
  10. tallanvor

    tallanvor Member

    Joined:
    Oct 9, 2007
    Messages:
    18,773
    Likes Received:
    11,961
    yeah i based it off his first post. not the second. didnt see that one
     
  11. JuanValdez

    JuanValdez Member

    Joined:
    Feb 14, 1999
    Messages:
    35,103
    Likes Received:
    15,314
    Fair enough. He said he wanted a formula. Looking at his picture, he obviously doesn't. He needs a filter or a macro to do that.
     
    #11 JuanValdez, Jul 17, 2014
    Last edited: Jul 17, 2014
  12. tallanvor

    tallanvor Member

    Joined:
    Oct 9, 2007
    Messages:
    18,773
    Likes Received:
    11,961
    try this macro

    Sub foo()
    RowCount = 2
    For Each cell In Range(Cells(topRow, 2), Cells(bottomRow, 2))
    If cell.Value <> "" Or Cells(cell.Row, 3) <> "" Then
    Cells(RowCount, 5).Value = Cells(cell.Row, 1).Value
    Cells(RowCount, 6).Value = cell.Value
    Cells(RowCount, 7).Value = Cells(cell.Row, 3).Value
    RowCount = RowCount + 1
    End If
    Next cell
    End Sub
     
    #12 tallanvor, Jul 17, 2014
    Last edited: Jul 17, 2014
  13. heypartner

    heypartner Member

    Joined:
    Oct 27, 1999
    Messages:
    63,517
    Likes Received:
    59,021
    Was just fixing your typo. :)

    Yeah. That should do it, now that you fixed the typo where rowcount was used on both sides of the assignment
     
  14. B-Bob

    B-Bob "94-year-old self-described dreamer"
    Supporting Member

    Joined:
    Jul 26, 2002
    Messages:
    35,987
    Likes Received:
    36,846
    I think what you really want is for us to guess the true nature of this data and the true nature of your... calculation.

    I vote it is scatological.
     
  15. heypartner

    heypartner Member

    Joined:
    Oct 27, 1999
    Messages:
    63,517
    Likes Received:
    59,021
    Looks like Jontro's chart of which of his two favorite p*rn sites he masturbated to each day, and how many times.
     
  16. Haymitch

    Haymitch Custom Title

    Joined:
    Dec 22, 2005
    Messages:
    28,371
    Likes Received:
    24,021
    Thanks for the tips. I figured it out, mostly. I just used filters as suggested by heyp, but I was hoping there was an easier way. I was hoping Table 2 could be the final, polished table that would automatically update while Table 1 was my working table I'd have in the background. I didn't want to have to filter out each Value column and copy and paste it to a separate table, then sort the dates from earliest to latest (the dates from the actual data set aren't chronological).

    Oh well. It was just something I was trying to go above-and-beyond to help clean something up for someone else on my team. I'll tackle it again next week for the next month's report since this month's report is due today.

    Anyway, thanks all for helping me with my Poop Count Report.

    (And no, cheke, I didn't get laid off. I was instead given a ****acular job, and over two months I had to run from person to person singing my song of woe that I may be given a job more to my liking. And it happened a few weeks ago, so hooray!)
     
  17. JuanValdez

    JuanValdez Member

    Joined:
    Feb 14, 1999
    Messages:
    35,103
    Likes Received:
    15,314
    I think this is still possible formulaically, but it'd probably be way over-built. Your destination table would need if/then logic to decide which dates to populate, and then some vlookups paired with if/then logic to pull the right numbers. It'd have to be a pretty critical table to do all that mess for.
     
  18. heypartner

    heypartner Member

    Joined:
    Oct 27, 1999
    Messages:
    63,517
    Likes Received:
    59,021
    Hey, I just did it with one concatentation formula and a Pivot Table.

    The Pivot Table will sort the date column, and filter by the Concatenation formula in the original table. I can post screen shots, if you want.

    It can also grow dynamically as you add to your original Poop Count Table.

    This might be the easiest way.
     
    #18 heypartner, Jul 17, 2014
    Last edited: Jul 17, 2014
  19. heypartner

    heypartner Member

    Joined:
    Oct 27, 1999
    Messages:
    63,517
    Likes Received:
    59,021
    sorry, double post.

    Got to go run an errand, but I'll give you the steps of using a pivot table to do this.
     
  20. Haymitch

    Haymitch Custom Title

    Joined:
    Dec 22, 2005
    Messages:
    28,371
    Likes Received:
    24,021
    That'd be great if you could show screenshots.
     
    1 person likes this.

Share This Page