Excel Help Thread

Discussion in 'The Mainboard' started by Gin Buckets, May 28, 2015.

  1. NDfanPSUgrad

    NDfanPSUgrad Well-Known Member
    Penn State Nittany LionsNotre Dame Fighting Irish

    I always start with a simple index match formula just to test it and understand. Step through the calculation so you can get a feel for how it takes a value and looks up an array. Once you understand that it's returning the index you want, you just have to point to another array and use that index.

    It works similar to a Vlookup or Hlookup but it doesn't have to be formatted with your lookup value in the first column or top row.
     
  2. NDfanPSUgrad

    NDfanPSUgrad Well-Known Member
    Penn State Nittany LionsNotre Dame Fighting Irish

    I can probably look at it tomorrow. Write something up with what you need or an example calculation. Pm me and I'll send you my email so you can share the file.
     
  3. Walt Disney

    Walt Disney #Dawgzy
    Donor TMB OG
    Georgia BulldogsManchester City

    Bunch of basics in here still using excel for BI stuff
     
    StinkusP1nkus likes this.
  4. grimreeper46

    grimreeper46 Active Member

    Can you just share the workbook? Only issue there is if people are updating it at the same time.
     
    #104 grimreeper46, Apr 16, 2016
    Last edited: Apr 16, 2016
  5. Gin Buckets

    Gin Buckets Well-Known Member
    Donor
    Virginia Tech HokiesIndiana HoosiersAtlanta BravesAtlanta HawksAtlanta Falcons

    I don't use filters often, so question for everyone. I have a set of about 20 values I want to be included in a filter. Anyone know how to do that? I clicked select and "add current filter to selection", but that didn't work.

    For example (this spreadsheet is 200k lines btw) the final column is a concatenation of 6 columns before that look like this "28-02" so the concatenation is anywhere from 1 to 6 numbers, and looks like "28-02, 28-08, 25-05, 29-01" and too any variation thereof. How can I do this efficiently?

    For context, there are like 20 numbers that will make up a larger category I need to sort out, and as long as it contains one of those numbers I need to include it. Does that make sense?
     
  6. Baron

    Baron Well-Known Member
    Donor
    Cincinnati BearcatsCincinnati RedsCincinnati BengalsTennisTiger WoodsFC Cincinnati

    a snapshot of the data may be helpful to see how it's laid out in the spreadsheet.
     
  7. Gin Buckets

    Gin Buckets Well-Known Member
    Donor
    Virginia Tech HokiesIndiana HoosiersAtlanta BravesAtlanta HawksAtlanta Falcons

    This might not be the best snap shot, because I'm most worried about sorting from the AQ column (ignore the column headings, they are wrong). That column can also look like the AL column, and what I'm sorting by has to contain any of a set of numbers. (Basically, the numbers represent sub-categories that roll up to a larger class, so as long as a category is included, so should the class).

    upload_2016-6-1_11-15-3.png
     
  8. Capstone 88

    Capstone 88 Going hard in the paint
    Donor
    Alabama Crimson TideAtlanta BravesTennessee TitansNashville Predators2pac

    A rudimentary way, but maybe create a column to the side that says =if(AQ2=number you need,"yes","no") then filter by yes from that column
     
    tmbrules and Gin Buckets like this.
  9. Baron

    Baron Well-Known Member
    Donor
    Cincinnati BearcatsCincinnati RedsCincinnati BengalsTennisTiger WoodsFC Cincinnati

    This may work?
    http://www.techonthenet.com/excel/filters/advanced1.php
     
    Gin Buckets and shawnoc like this.
  10. shawnoc

    shawnoc My president is black, my logos are red...
    Donor TMB OG
    Rutgers Scarlet KnightsNew Jersey DevilsNew York Red BullsLos Angeles Angels of Anaheim

    Use an advanced filter for this.
    Basically, make a list of all the things you want included, then filter in place or into a separate list.

    It's pretty simple, just google "excel advanced filter".
     
  11. BIGASSTITTIES

    BIGASSTITTIES Fan of: BIGASSTITTIES
    Donor

    Look at this guy

    Loveyoubro
     
    #111 BIGASSTITTIES, Jun 1, 2016
    Last edited: Jun 28, 2017
  12. dawgonit

    dawgonit Like James Brown only white and taller
    Donor
    Georgia BulldogsAtlanta BravesAtlanta FalconsAtlanta United

    have 3 columns of data and want to make a scatter plot chart where each row is its own series. I know I have used a macro for this but can't remember/find the spreadsheet. halp.
     
  13. shawnoc

    shawnoc My president is black, my logos are red...
    Donor TMB OG
    Rutgers Scarlet KnightsNew Jersey DevilsNew York Red BullsLos Angeles Angels of Anaheim

    Don't think you need a macro, just Insert>Charts>Scatter
     
  14. dawgonit

    dawgonit Like James Brown only white and taller
    Donor
    Georgia BulldogsAtlanta BravesAtlanta FalconsAtlanta United

    I need each row to be its own series. So I could add a series for each one, but I have about a thousand rows
     
  15. shawnoc

    shawnoc My president is black, my logos are red...
    Donor TMB OG
    Rutgers Scarlet KnightsNew Jersey DevilsNew York Red BullsLos Angeles Angels of Anaheim

    Insert>Charts>Scatter
    Then right click on the chart...
    Select Data>Switch Rows/Columns
     
  16. dawgonit

    dawgonit Like James Brown only white and taller
    Donor
    Georgia BulldogsAtlanta BravesAtlanta FalconsAtlanta United

    figured it out

    Sub CreateChart()

    Dim lngRow As Long
    Dim lngStartRow As Long
    Dim objChart As Chart
    Dim objSeries As Series

    Set objChart = ActiveSheet.ChartObjects.Add( _
    100, 100, 400, 250).Chart
    objChart.ChartType = xlXYScatterLines

    lngStartRow = 2
    lngRow = 2
    With ActiveSheet
    lngStartRow = 2
    lngRow = 2
    Do While Len(.Cells(lngRow, 1).Value) > 0
    If .Cells(lngStartRow, 2) <> .Cells(lngRow, 2) Then
    ' deal with grouped ID
    Set objSeries = objChart.SeriesCollection.NewSeries
    objSeries.Name = .Cells(lngStartRow, 2).Value
    objSeries.XValues = Range("D" & lngStartRow, "D" & lngRow - 1)
    objSeries.Values = Range("C" & lngStartRow, "C" & lngRow - 1)
    lngStartRow = lngRow
    End If
    lngRow = lngRow + 1
    Loop
    Set objSeries = objChart.SeriesCollection.NewSeries
    objSeries.Name = .Cells(lngStartRow, 2).Value
    objSeries.XValues = .Range("D" & lngStartRow, "D" & lngRow - 1)
    objSeries.Values = .Range("C" & lngStartRow, "C" & lngRow - 1)
    lngStartRow = lngRow
    End With

    End Sub
     
  17. dawgonit

    dawgonit Like James Brown only white and taller
    Donor
    Georgia BulldogsAtlanta BravesAtlanta FalconsAtlanta United

    this is really close to working - I may play with it some more. thanks.
     
  18. Where Eagles Dare

    Where Eagles Dare The Specialist Show On Earth
    Donor
    Auburn TigersAtlanta BravesWashington Football TeamAtlanta United

    Y'all need to graduate from Excel and get into some easier shit.

    Download powerbi and start learning some basic DAX.
     
  19. Koby Salman

    Koby Salman Well-Known Member

    nm got it
     
    #119 Koby Salman, Jul 13, 2016
    Last edited: Jul 13, 2016
  20. shawnoc

    shawnoc My president is black, my logos are red...
    Donor TMB OG
    Rutgers Scarlet KnightsNew Jersey DevilsNew York Red BullsLos Angeles Angels of Anaheim

    Is it always going to be the same length?
    If so, something like this:
    =CONCATENATE(LEFT(A1,3),"-",MID(A1,4,3),"-",RIGHT(A1,4))
     
    Koby Salman likes this.
  21. Koby Salman

    Koby Salman Well-Known Member

    Yeah.

    I got it - I just used the Custom Number Format of "####-####-##"
     
  22. Jax Teller

    Jax Teller Well-Known Member
    Donor
    Alabama Crimson TideAtlanta BravesTennessee TitansNashville PredatorsNashville SC

    So is it possible to have get a formula that is going sideways, to ref cells that are going down on another sheet?

    Like sheet 1 has month by month averages going from columns B to M.
    Sheet 2 has monthly averages going down.. ie E1-e12.

    I'm trying to get the formula on sheet 1 to go across while the cells it's referencing go down. I have not been able to figure out a way to do that.
     
  23. Capstone 88

    Capstone 88 Going hard in the paint
    Donor
    Alabama Crimson TideAtlanta BravesTennessee TitansNashville Predators2pac

    Sumifs
     
    Jax Teller likes this.
  24. NDfanPSUgrad

    NDfanPSUgrad Well-Known Member
    Penn State Nittany LionsNotre Dame Fighting Irish

    Some type of Index Match would work
     
    Jax Teller likes this.
  25. Baron

    Baron Well-Known Member
    Donor
    Cincinnati BearcatsCincinnati RedsCincinnati BengalsTennisTiger WoodsFC Cincinnati

    Ok here is my issue, I am trying to do a couple SUMIF statements, one seems to be working, the other doesn't.. so I am not sure what is going on.
    upload_2017-5-16_9-24-52.png
    formula in C7 =SUMIF(Transactions!V:V,">-1",Transactions!M:M)
    formula in C8 =SUMIF(Transactions!N:N,"not yet received",Transactions!M:M)

    my problem is cell C8. As seen in B8, there are 1029 records showing "not yet received" in the 'Transactions' tab, in range N:N. I want to sum all those transactions "not yet received".
     
  26. Capstone 88

    Capstone 88 Going hard in the paint
    Donor
    Alabama Crimson TideAtlanta BravesTennessee TitansNashville Predators2pac

    There's probably something wrong with the way you typed "not yet received"
     
  27. Name P. Redacted

    Name P. Redacted I have no money and I'm also gay
    Donor
    Kansas State WildcatsSeattle Kraken

    What does it tell you the error is?
     
  28. Name P. Redacted

    Name P. Redacted I have no money and I'm also gay
    Donor
    Kansas State WildcatsSeattle Kraken

    My guess is there's something fucked up with Transactions!N:N
     
  29. Baron

    Baron Well-Known Member
    Donor
    Cincinnati BearcatsCincinnati RedsCincinnati BengalsTennisTiger WoodsFC Cincinnati

    so if the formula in B8 works, =COUNTIF(Transactions!N:N,"not yet received", and and gets the count right seems odd my sumif isn't working.

    I guess what do you mean by fucked up?
     
  30. Name P. Redacted

    Name P. Redacted I have no money and I'm also gay
    Donor
    Kansas State WildcatsSeattle Kraken

    Actually maybe there's a bad value in the sum_range? Idk, it's hard to tell without having the Excel file. There's something that is breaking the SUMIF function, because it looks like your syntax is good. There's gotta be something wrong in the ranges. Maybe a number is saved as text instead of number, or something.

    You could try
    formula in C8 =SUMIF(Transactions!N:N,"not yet received",numbervalue(Transactions!M:M))
     
  31. Baron

    Baron Well-Known Member
    Donor
    Cincinnati BearcatsCincinnati RedsCincinnati BengalsTennisTiger WoodsFC Cincinnati

    getting this error with that formula:
    upload_2017-5-16_10-9-19.png
     
  32. Baron

    Baron Well-Known Member
    Donor
    Cincinnati BearcatsCincinnati RedsCincinnati BengalsTennisTiger WoodsFC Cincinnati

    I'm thinking column M is fucked up

    prob these #DIV/0! errors?

    upload_2017-5-16_10-12-47.png
     
  33. Name P. Redacted

    Name P. Redacted I have no money and I'm also gay
    Donor
    Kansas State WildcatsSeattle Kraken

    Great tip Excel. Seems like it doesn't recognize the SUMIF function? Dunno.
     
  34. Name P. Redacted

    Name P. Redacted I have no money and I'm also gay
    Donor
    Kansas State WildcatsSeattle Kraken

    Yeah that's likely gonna mess it up.
     
  35. Baron

    Baron Well-Known Member
    Donor
    Cincinnati BearcatsCincinnati RedsCincinnati BengalsTennisTiger WoodsFC Cincinnati

    this is what I get for trying to fix a spreadsheet that someone else made that no longer works here
     
  36. NDfanPSUgrad

    NDfanPSUgrad Well-Known Member
    Penn State Nittany LionsNotre Dame Fighting Irish

    Pivot table would probably be much easier than what you are doing
     
  37. Baron

    Baron Well-Known Member
    Donor
    Cincinnati BearcatsCincinnati RedsCincinnati BengalsTennisTiger WoodsFC Cincinnati

    It's a lot more complex than what I shared. I wish it was that easy. By 5pm today I came to the conclusion that a lot of data has been manipulated and jacked up causing all these errors.
     
  38. Baron

    Baron Well-Known Member
    Donor
    Cincinnati BearcatsCincinnati RedsCincinnati BengalsTennisTiger WoodsFC Cincinnati

    alright got another question, probably straight forward but not for me right now in my mind...

    what I am trying to do is if the date in Column A, sheet1 is a 2015 or 2016 date, pull in from sheet 2 the corresponding "Code" (column A) column's value for 2015 or 2016 from sheet 2 to sheet 1. i'm not sure if that makes complete sense or not.

    upload_2017-5-19_9-13-3.png upload_2017-5-19_9-15-47.png
     
  39. $P1

    $P1 Ball State #1
    Staff Donor TMB OG
    Michigan WolverinesChicago CubsLos Angeles LakersChicago BearsChicago BlackhawksWest Ham UnitedBall State Cardinals

    Easiest way to do what I think you're trying to do:

    Add another column in B that returns the year from the adjacent cell.

    =Year(A3)

    Then use B as the lookup instead of A
     
  40. Name P. Redacted

    Name P. Redacted I have no money and I'm also gay
    Donor
    Kansas State WildcatsSeattle Kraken

    Why even bother with a new column, just use Year(A3) in the original equation

    Also need to make sure the cell is formatted as Date
     
  41. Baron

    Baron Well-Known Member
    Donor
    Cincinnati BearcatsCincinnati RedsCincinnati BengalsTennisTiger WoodsFC Cincinnati

    what equation am i going to need to use for this?
     
  42. Name P. Redacted

    Name P. Redacted I have no money and I'm also gay
    Donor
    Kansas State WildcatsSeattle Kraken

    What are the names of the sheets
     
  43. Baron

    Baron Well-Known Member
    Donor
    Cincinnati BearcatsCincinnati RedsCincinnati BengalsTennisTiger WoodsFC Cincinnati

    let's just call them sheet1 and sheet2 as i have in those screenshots.
     
  44. allothersnsused

    allothersnsused Wow that’s crazy
    Donor
    Virginia CavaliersAtlanta BravesAtlanta HawksWashington Football TeamChelsea

    I've got an easy one because I'm a total noob.

    I work in a job that isn't finance related, but work closely with a lot of finance guys who use excel. Because of this, I'm trying to create my own spreadsheets for random shit to learn by doing. One of them I've made is for my gambling winnings this year. I want to build a formula that will give me a weighted average winning percentage. For example, I've placed 3 bets so far, and I'm 2-1. But I've placed bets of $30, $11, and $33 on them. I want to weight my win percentage by the dollars bet, calculated automatically. I can't for the life of me figure out how to do this in excel (I have it on Google Sheets but I'm sure the answer is similar). Pic of sheet is attached below.


    Capture.JPG

    Would also love to know how i can code the 0/1 to be L/W but I'll save that for another day.
     
  45. Goose

    Goose Hi
    Donor
    Ohio State BuckeyesCincinnati BearcatsCincinnati RedsCincinnati BengalsReal MadridXavier MusketeersDayton FlyersTiger WoodsFC CincinnatiPGA

    For 0/1 to be L/W:

    =if(A1=0,"L","W")

    Basically the if statement is saying if cell A1 =0, it will show L. If it's anything else it will show W
     
  46. allothersnsused

    allothersnsused Wow that’s crazy
    Donor
    Virginia CavaliersAtlanta BravesAtlanta HawksWashington Football TeamChelsea

    Can I make it such that I can just enter W or L in that column and have them equal 1 or 0? Or do I need a separate column where I enter 1, 0 and it shows W/L in a new column?
     
  47. Goose

    Goose Hi
    Donor
    Ohio State BuckeyesCincinnati BearcatsCincinnati RedsCincinnati BengalsReal MadridXavier MusketeersDayton FlyersTiger WoodsFC CincinnatiPGA

    I take it you're just trying to show the percentage correct?

    Try:

    =COUNTIF(G1:G3,"W")/COUNTA(G1:G3)
     
  48. shawnoc

    shawnoc My president is black, my logos are red...
    Donor TMB OG
    Rutgers Scarlet KnightsNew Jersey DevilsNew York Red BullsLos Angeles Angels of Anaheim

    You can make it part of the formula in the "Net" column.
    =If(g4="W",E4-D4,0-C4)
     
  49. shawnoc

    shawnoc My president is black, my logos are red...
    Donor TMB OG
    Rutgers Scarlet KnightsNew Jersey DevilsNew York Red BullsLos Angeles Angels of Anaheim

    What do you want the answer to be based on the three bets so far?

    You bet a total of $64 and won $30, so I'm assuming that you want a win % of about 75%?
    Betting $64 and losing $64 would be 0%, right?

    if so, it's just something like = (Total Winnings + Total Bet) / (2 * Total Bet)

    I guess that was more of an algebra answer than an excel answer, though.
     
  50. Name P. Redacted

    Name P. Redacted I have no money and I'm also gay
    Donor
    Kansas State WildcatsSeattle Kraken

    So you want your wins to be weighted against how much you money you bet?
    that should work