Excel Help Thread

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

  1. Name P. Redacted

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

    Yeah he needs to get his algebra clearly defined before we can do it in Excel
     
  2. allothersnsused

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

    Yeah the lightbulb came on when I was trying to figure out how to get around the basic problem that I couldn't weight a 0. It ended up being simpler that I thought, its just that whenever I got the formula in like that it spit the answer out formatted in dollars, which made no sense to my pea brain. I finally figured out it was giving me the right answer, just formatted as $ instead of %

    Got to =SUMProduct(D4:D7*G4:G7)/SUM(D4:D7)
     
    #152 allothersnsused, Sep 13, 2017
    Last edited: Sep 13, 2017
    shawnoc likes this.
  3. buffs

    buffs Well-Known Member
    Donor
    Colorado BuffaloesMinnesota TimberwolvesMinnesota VikingsMinnesota WildMinnesota TwinsBig 8 Conference

    Anyone know how to reference data in workbooks that will all have a slightly different name to a master data repository sheet automatically? I think I have to use VBA, but I would prefer not to.
     
  4. pianoman

    pianoman my drinks are free
    Donor TMB OG
    Michigan WolverinesChicago CubsDetroit Red Wings

    You could probably use the INDIRECT function but I hate that thing as it's crazy easy to make mistakes with it.
     
    steamengine likes this.
  5. Baron

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

    Hopefully someone can help me out here, b/c I can't for the life of me figure out how I can do this in excel...

    What I am trying to do is identify all records in this file that contain a code of 99201-99215 and also include a code of lets say 96360 - 96417 for the same Date of Service (DOS). There are multiple dates and multiple times a person could show up too. If they don't meet that criteria, I don't care about them and wanna get rid of them in the list for my analysis.

    This is a snippet of what it looks like:
    upload_2018-5-1_11-10-4.png

    So in the example above, I wouldn't care about John, Jane or Jenny Doe, i would only care about Jim Doe. I have about 80k lines to go through so doing this by hand is not gonna happen. Any ideas?
     
  6. Tiger Tiger Woods Y'all

    Tiger Tiger Woods Y'all Putting big balls in little holes, circa 1995
    Donor
    Clemson TigersGolden State WarriorsPGA

    Simple pivot. Im assuming you cant send me the file because it will contain hella PHI

    I can create a dummy file and show you how.
     
    Baron likes this.
  7. NDfanPSUgrad

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

    Turn on filters and maybe convert them to numbers instead of text so you can filter ranges.
     
  8. Tiger Tiger Woods Y'all

    Tiger Tiger Woods Y'all Putting big balls in little holes, circa 1995
    Donor
    Clemson TigersGolden State WarriorsPGA

    For the love of all things holy god don't use filters.
     
  9. NDfanPSUgrad

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

    Why? Filter those records and copy them to a new sheet. Better option than a pivot table.
     
  10. Tiger Tiger Woods Y'all

    Tiger Tiger Woods Y'all Putting big balls in little holes, circa 1995
    Donor
    Clemson TigersGolden State WarriorsPGA

    Because filtered tables are the devil and should never be used. Certainly not with large data sets with multiple conditions. You don't have a view into whats filtered all at once, you have to click on each column to make sure you have the filtered info you want selected. In a pivot its much easier, more clear and less error prone.
     
  11. Baron

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

    I'm not filtering, let's see this pivot table solution.
     
  12. Name P. Redacted

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

    Use Python.
     
    Walt Disney likes this.
  13. Name P. Redacted

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

    Your option stops being useful if this is something you have to do more than once.
     
  14. Where Eagles Dare

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

    Put it in a SQL database and make your life 100000 easier.
     
    JeremyLambsFace likes this.
  15. NDfanPSUgrad

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

    i was assuming he was trying to identify all records so his data set only has the information he wants to analyze. For analysis, definitely a pivot table.
     
  16. Where Eagles Dare

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

    Just write a nested if statement for those ranges
     
    gocams and pianoman like this.
  17. Tiger Tiger Woods Y'all

    Tiger Tiger Woods Y'all Putting big balls in little holes, circa 1995
    Donor
    Clemson TigersGolden State WarriorsPGA

     
    #167 Tiger Tiger Woods Y'all, May 1, 2018
    Last edited: May 1, 2018
    Baron likes this.
  18. NDfanPSUgrad

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

    Nice filters.

     
    JeremyLambsFace likes this.
  19. Tiger Tiger Woods Y'all

    Tiger Tiger Woods Y'all Putting big balls in little holes, circa 1995
    Donor
    Clemson TigersGolden State WarriorsPGA

    lol filters were on because I had to create a formula and then sort alphabetically to blind my patient protected info, not to splice data or for analysis as you suggested.

    I was also just giving you shit. You could have filtered and survived.
     
    #169 Tiger Tiger Woods Y'all, May 1, 2018
    Last edited: May 1, 2018
    NDfanPSUgrad likes this.
  20. NDfanPSUgrad

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

    All good. Just giving you shit as well. Always multiple ways to accomplish a task.
     
  21. Baron

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

    I'm not sure I explained it clearly enough, but what I need to identify are those patients that have a code of range x to y, if they have a code in the range of x to y, then i need to see if they had another code in a range of y to z on the same date of service. If they have both, let me know they have both on the same date of service.

    i.e.
    Jim Doe had code 99215 (this is one range) on 6/29/16, he also had code 96365 and 96366 (these codes call in another range). This is what I am trying to identify and pull out from a large dataset.
    John Doe I wouldn't care about b/c he only had a 99214 on 6/13/16 and no other codes on that day.
    [​IMG]
     
  22. NDfanPSUgrad

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

    Pivot your data. Rows will be the unique patient ID. Columns would be the CPT Codes (select only the codes in ranges you want to see). Pick any column to be a count of the data in that range. At least this would organize your data easier with one row per patient and a count of all their CPT Codes. You can quickly sum the row and find anything that had 1 vs multiple.
     
    Baron likes this.
  23. grimreeper46

    grimreeper46 Active Member

    I feel like I'm way overthinking this but can't think of an easier way. One major assumption is that you're only trying to identify when a patient had both codes on the same day. You mention you don't care about John Doe because he has only 1 code. Would you care if John Doe had a code 96365 on a different day? If the answer is no, I have a solution.

    Using the same set up you presented, Title cell E1 "Primary ID", F1 "Compound", and G1 "Find".
    In E2 type the formula =IF(D2=99215,A2,"") and format this as a number.

    This will identify the person and the date in which they had the primary Code Procedure.

    In F2 type the formula =IF(E2="","",B2&E2) which will concatenate the Patient Name and Date of Service only for cells that meet the Primary Criteria.

    In G2 type the formula =IF(D2=96365,FIND(F:F,B2&E2),""). This is where I identified Patient Name and Date of Service combinations that matched both criteria. The end result is a value of 1 in G4 since Jim Doe had CPT code 96365 and 99215 on the same day. The rest of the records should be blank.
     
  24. Cheshire Bridge

    Cheshire Bridge 2017 & 2019 National Champions - Clemson Tigers
    Donor
    Clemson TigersAtlanta BravesTiger WoodsCollege Football Playoff

    *Sort A-Z and add a level.
    *pivot
     
  25. Where Eagles Dare

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

    Just make 4 new columns to make it easier.

    Column 1, If date = date then 1
    Column 2, if value 1 between x and y then 1
    Column 3, if value 2 between x and y then 1

    You can then use an and function on all 3 or just sum the 3 columns in column 4 and do an if statement on the and. If column1:Column3 =3 then "Whatever you want for true"

    Now you have all your variables
     
  26. 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

    OK, so here's how I'd do it...

    First of all, I wouldn't use patient name, please find another less ambiguous field like patient ID.
    Here's a random page that I made:
    upload_2018-5-2_11-21-6.png

    Second, Pivot the data.
    upload_2018-5-2_11-22-12.png

    I then threw out months from the rows and changed the values from "sum" to "count"

    Then I grouped the column headers:

    upload_2018-5-2_11-25-31.png

    And collapsed the groups

    upload_2018-5-2_11-26-25.png

    Then I switched both row values to "Tabular form" so that the appear next to eachother rather than one being a sub of the other and it looked like this:

    upload_2018-5-2_11-30-33.png


    So the top patient, number 127, had 3 treatments with codes between 99214 and 99216 on 4/22 but didn't have any with the codes 99217-99219. He also had one that wasn't in that range.

    How's this look?

    (That'll be $25, btw).
     
    #176 shawnoc, May 2, 2018
    Last edited: May 2, 2018
    steamengine and Baron like this.
  27. steamengine

    steamengine I don’t want to press one for English!
    Donor
    Duke Blue DevilsHouston AstrosKansas City ChiefsLiverpool

    Put me on team pivot tables default format should be tabular.
     
    Capstone 88, Baron and shawnoc like this.
  28. 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

    I know, right? I edit 75% of my tables that have more than one value in the row field.
    (Actually, I secretly like that it doesn't default to that because I get to look smart by knowing how to change it.)
     
    steamengine likes this.
  29. steamengine

    steamengine I don’t want to press one for English!
    Donor
    Duke Blue DevilsHouston AstrosKansas City ChiefsLiverpool

    That’s so true. Most of the time I’m showing excel illiterate people something mind blowing, that’s the trick.
     
    shawnoc likes this.
  30. jrmy

    jrmy For bookings contact Morgan at 702-374-3735
    Donor
    South Carolina GamecocksAtlanta BravesDallas CowboysNational LeagueAvengersBarAndGrill

    I can remember the first time I found out about the tabular view and just having my mind blown at how awesome it was.
     
    shawnoc likes this.
  31. Tiger Tiger Woods Y'all

    Tiger Tiger Woods Y'all Putting big balls in little holes, circa 1995
    Donor
    Clemson TigersGolden State WarriorsPGA

    Pivot works looking for grouped ranges of values and not specific values.

    I did an index match array which pulls the actual code for each dos and PT ID concatenation, but it’s a pita.

    Pivot is definitely easier if the output suffices
     
  32. Baron

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

    That's perfect. Tiger Tiger Woods Y'all way worked, but it was definitely more complex.

    Alright so one last thing (sorry for noob questions)... So I need to flip these two groups around, I need Office Visit Codes in front of Injections (see below). I also need a formula to identify for me when there is a value in the injections column, but no number in the office visit column. Example: so for DOS 2/25/16, there were 2 codes for injections, but not codes for office visits, I'd want to flag this as such. I am sure its some type of IF statement.

    upload_2018-5-2_13-32-26.png
     
  33. Baron

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

    Nvm on the column thing. I got that.
     
  34. Baron

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

  35. dawgonit

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

    =IF(AND(ISNUMBER(C6),ISNUMBER(D6)),"","FLAG")
     
    Baron likes this.
  36. Baron

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

    Thanks. It is flagging row 8 when there are numbers in both cells, how can i modify the formula to not flag when there are numbers in both column B and C?
     
  37. dawgonit

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

    It shouldn't be doing that. Check and make sure it's referencing C8 and D8
     
    Baron likes this.
  38. Baron

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

    Ok, that's working, not sure what happened. I had to change the reference to B and C cells, i don't care about column D. However, I do not care if column C is blank if there is a value in column B. Is there a work around that not flagging in that occurrence?

    i.e. I don't care about Row 11, 12, 13, etc...
    upload_2018-5-3_12-30-37.png
     
  39. 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

    it’s very tricky to make a formula that references a row or value in a pivot table.
    Instead, Copy the pivot table, paste values only into a new tab or sheet, run formulas on the pasted table.
    You don't work for a particular hospital on the upper west side, do you?
    (I'm waiting for a call back on an interview.)
     
  40. Baron

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

    No.
     
    shawnoc likes this.
  41. dawgonit

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

    have a date/time question:

    facility where I work counts delivery days as 6am to 6am and we get deliveries 24/7. I have data with time-stamp of delivery but need to setup a formula to manipulate the days to mirror the 6am to 6am "delivery date"

    there has to be an IF function involving the date serial number but I cannot figure it out

    TIA
     
  42. NDfanPSUgrad

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

    Subtract 6 hours from the date. Whatever your time stamp cell is - (6 / 24)
     
    Henry Blake, Baron and dawgonit like this.
  43. dawgonit

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

    so much simpler than I was making it :facepalm:
     
    NDfanPSUgrad likes this.
  44. ned's head

    ned's head Well-Known Member
    Donor

    I have a sheet that is used for time tracking. I have my workdays going from left to right and want to shade every other week gray. I figured out how to do this once for every 5 days, but is there a conditional formatting formula to do this for alternating blocks of 5?

    Nm... Internet knows all
     
    #194 ned's head, Oct 9, 2020
    Last edited: Oct 9, 2020
    Name P. Redacted likes this.
  45. Tiger Tiger Woods Y'all

    Tiger Tiger Woods Y'all Putting big balls in little holes, circa 1995
    Donor
    Clemson TigersGolden State WarriorsPGA

    yes. Hth
     
  46. ned's head

    ned's head Well-Known Member
    Donor

    Got another burner. Let's say I have two numbers that I've converted to a percentage that are in cells a1 (5%) and b1 (10%). I want to combine those to one cell that says 5% - 10%.

    I've tried the concat and concatenate functions, but I can only get the raw decimal numbers and it won't let me format it to percentages without decimals. Any ideas?
     
  47. 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

    I’m not in front of a computer so I’m guessing from my phone…

    =concatenate(text(A1,0%),” - “,text(B1,0%))
     
  48. Marty Kaan

    Marty Kaan By any means necessary
    Donor

    this is correct
     
    steamengine and shawnoc like this.
  49. Where Eagles Dare

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

    Concatenate operator is now pipe vs coma when you upgrade to Windows 11
     
    shawnoc likes this.
  50. NP13

    NP13 MC OG
    Donor
    East Carolina PiratesAtlanta BravesCharlotte HornetsCarolina PanthersWashington Football TeamCarolina HurricanesAvengers

    i tried that and it didn't work
     
    shawnoc likes this.