|
Bob Morales posted:What's the best way to go from this: Assuming your dataset is A1:B3, use the following formula in any cell on the worksheet and stretch it to the right: =OFFSET($A$1,ROUND(COLUMN(A1)/2,0)-1,MOD(COLUMN(A1)-1,2)) so that cell 1 is above, and cell 2 is the following: =OFFSET($A$1,ROUND(COLUMN(B1)/2,0)-1,MOD(COLUMN(B1)-1,2)) and so on.
|
# ? Aug 19, 2016 04:17 |
|
|
# ? Apr 19, 2024 14:51 |
|
fosborb posted:Assuming your dataset is A1:B3, use the following formula in any cell on the worksheet and stretch it to the right:
|
# ? Aug 19, 2016 18:06 |
|
Not sure how "small" this question is, but I have the following situation. I'm keeping track of a game I play, based on scenarios for it, and which game pieces are used in which scenario. Since I don't own all the expansions and whatnot, I want to be able to selectively color or filter out scenarios I can't play with what I have. So, on one sheet, just to be simple, I have, for instance: code:
|
# ? Aug 19, 2016 18:08 |
|
COOL CORN posted:I'm trying to figure out how to filter out the scenarios, for example, "I only have maps 21 and 24, I want to color all of the scenarios that use OTHER maps red" or something. Should I use VBA to split that column into an array and then use that array to selectively color the rows? =SUMPRODUCT(--ISNUMBER(SEARCH({"21","24"},B10)))>0 It will return 1 if it matches 1, 2 if it matches 2....you could color it on that
|
# ? Aug 19, 2016 18:17 |
|
Bob Morales posted:=SUMPRODUCT(--ISNUMBER(SEARCH({"21","24"},B10)))>0 Almost perfect, but matching single number is a problem. I guess I could use leading 0s. (i.e. SEARCH({"1"}, B10) is matching 21, 31, 41, etc.) edit-- Is there a way I can save the array in a hidden cell and refer to it? Having {"1", "2", "3"} in cell AA2, and then using SEARCH(AA2, B10) isn't working. Count Thrashula fucked around with this message at 18:59 on Aug 19, 2016 |
# ? Aug 19, 2016 18:48 |
|
COOL CORN posted:Almost perfect, but matching single number is a problem. I guess I could use leading 0s. What if you put them all in a range of cells and just used that range (AA1:AA5 for example) to reference them?
|
# ? Aug 19, 2016 21:32 |
|
You may want to consider using a small database for this, or perhaps making a 1:1 relationship of scenarios to maps rather than trying to stuff the maps into one cell. That way, you could either use a filter to pull out the values you need or use a PivotTable to summarize them.
|
# ? Aug 19, 2016 21:47 |
|
Bob Morales posted:What's the best way to go from this: I ended up doing it in Python code:
|
# ? Aug 23, 2016 20:20 |
|
That's pretty slick! So what kind of clusterfuck are you in where you legitimately have to pull out python to manhandle Excel data, and also that you're loving about with Excel data AND have permissions to execute python scripts at all?
|
# ? Aug 24, 2016 07:17 |
|
fosborb posted:That's pretty slick! Exporting data from one ERP system to another. Not sure why they want it in that format when they have imported it before in the regular horizontal format. code:
code:
Then add in the fact that we have part numbers like 1234.10 1234.20 with TRAILING ZEROS So you have to be ultra-careful at every step of importing, exporting to make sure you don't lose those. Excel loves to HELP YOU OUT and hide data especially with CSV's. gently caress.
|
# ? Aug 24, 2016 15:40 |
|
Bob Morales posted:So you have to be ultra-careful at every step of importing, exporting to make sure you don't lose those. Excel loves to HELP YOU OUT and hide data especially with CSV's. gently caress. A not uncommon problem with Excels helpfulness Abstract posted:The spreadsheet software Microsoft Excel, when used with default settings, is known to convert gene names to dates and floating-point numbers. A programmatic scan of leading genomics journals reveals that approximately one-fifth of papers with supplementary Excel gene lists contain erroneous gene name conversions.
|
# ? Aug 24, 2016 20:27 |
|
Oh Christ. Are the people responsible for the state of things you're in even still alive?
|
# ? Aug 24, 2016 20:29 |
|
I'm trying to make an Excel function take a value and return multiple rows from a table line-by-line containing said value, but for the life of me I cannot figure out how to do it. Can anyone give me a code sample or point me to one online? Spent hours beating my head against this with various index-match and vlookup examples from Google .
|
# ? Sep 5, 2016 18:22 |
|
Neddy Seagoon posted:I'm trying to make an Excel function take a value and return multiple rows from a table line-by-line containing said value, but for the life of me I cannot figure out how to do it. Can anyone give me a code sample or point me to one online? Spent hours beating my head against this with various index-match and vlookup examples from Google . But why are you trying to do this in a formula? You should probably either just use a filter or use an actual programming language depending on your needs.
|
# ? Sep 5, 2016 18:34 |
|
Neddy Seagoon posted:I'm trying to make an Excel function take a value and return multiple rows from a table line-by-line containing said value, but for the life of me I cannot figure out how to do it. Can anyone give me a code sample or point me to one online? Spent hours beating my head against this with various index-match and vlookup examples from Google . That sounds like some really advanced stuff that's meant for a VBA sub or Python rather than a function. Maybe this will help: https://colinlegg.wordpress.com/2014/08/25/self-extending-udfs-part-1/
|
# ? Sep 6, 2016 00:11 |
|
schmagekie posted:That sounds like some really advanced stuff that's meant for a VBA sub or Python rather than a function. Maybe this will help: https://colinlegg.wordpress.com/2014/08/25/self-extending-udfs-part-1/ That link gave me some decent ideas and I actually got what I needed working in Powershell (Along with the script converting to a .csv file first so it didn't plod along slowly line-by line). Think I just got stuck beating my head on this and needed a fresh perspective, thankyou.
|
# ? Sep 6, 2016 08:25 |
|
I have 500+ sheets with lists of people and start and finish times. Unfortunately the system which generates them puts multiple start/finish pairs for the same day in the same cell - as in O7/P7 below - which means formulas trying to total up hours across the year don't work. I'm trying to find a way to insert a row where a multi-line entry is present and split the entry/entries like this: But if there's a way to total hours with the data as it is in the first screenshot that would also work. I've done a whole lot of Googling over the last couple of days and tried out a bunch of VBA and non-VBA things to accomplish this but I haven't yet found anything that does the trick. If anyone can help I'd be super grateful. Jack the Lad fucked around with this message at 10:07 on Sep 16, 2016 |
# ? Sep 16, 2016 10:03 |
|
How clean is the data? My first thought is a VBA script which runs through the sheet totalling hours in column Z (or wherever), but it would be looking a) for pairs of filled cells (i.e. a start and a finish) and b) for anything which deviated form the ##:## time format. But if your data isn't as neat as you've presented it that won't fly.
|
# ? Sep 16, 2016 12:21 |
|
potatocubed posted:How clean is the data? It comes with some merged cells and stuff, but it's pretty clean:
|
# ? Sep 16, 2016 14:42 |
|
Alright, paste this into a module and give it a go. Remember to change targCol to be the column where you want the totals to appear (I chose Z arbitrarily) and startRow to be the row where your data starts. It also assumes that there are no gaps in Column A, because that's how it knows when to stop. It's got some rudimentary error checking in, so hopefully even if it's not 100% perfect it'll highlight the few rows you need to manually check. pre:Sub DoTheThing() Dim targCol As String targCol = "Z" 'Change this to a column of your choice. Dim startRow As Integer startRow = 2 'Change this to the first row with data. Dim ts1 As String Dim ts2 As String Dim lts1 As Integer Dim lts2 As Integer Dim numOnly As String Dim check As Boolean Dim hourCount As Double Dim ws As Worksheet Set ws = ActiveSheet For i = startRow To 10000000 If ws.Cells(i, 1) = "" Then Exit For check = True hourCount = 0 If WorksheetFunction.CountA(ws.Range("C" & i & ":P" & i)) mod 2 = 0 Then 'Matching pairs. Next! For j = 3 To 15 Step 3 'Getting them in pairs. ts1 = WorksheetFunction.Text(ws.Cells(i, j), "hh:mm") ts2 = WorksheetFunction.Text(ws.Cells(i, j + 1), "hh:mm") 'I could handle this so much better, but I *really* need to be somewhere else right now. If ts1 = "" Then ts1 = "00:00" If ts2 = "" Then ts2 = "00:00" 'Clean yo data. numOnly = "" For k = 1 To Len(ts1) If IsNumeric(Mid(ts1, k, 1)) Then numOnly = numOnly & Mid(ts1, k, 1) End If Next k ts1 = numOnly numOnly = "" For k = 1 To Len(ts2) If IsNumeric(Mid(ts2, k, 1)) Then numOnly = numOnly & Mid(ts2, k, 1) End If Next k ts2 = numOnly 'Is it a simple one? If (Len(ts1) = 4) And (Len(ts2) = 4) Then 'Yup hourCount = hourCount + TimeCounter(ts1, ts2) Else 'Nope If (Len(ts1) <> Len(ts2)) Or (Len(ts1) Mod 4 <> 0) Or (Len(ts2) Mod 4 <> 0) Then check = False ws.Range(targCol & i) = "Data error!" Exit For End If lts1 = (Len(ts1) / 4) - 1 lts2 = (Len(ts2) / 4) - 1 ReDim tArray1(lts1) As String ReDim tArray2(lts2) As String 'Loop through the numbers to get matching pairs. For k = 0 To UBound(tArray1) tArray1(k) = Mid(ts1, (k * 4) + 1, 4) tArray2(k) = Mid(ts2, (k * 4) + 1, 4) Next k For k = 0 To UBound(tArray1) hourCount = hourCount + TimeCounter(tArray1(k), tArray2(k)) Next k End If Next j If check Then ws.Range(targCol & i) = hourCount Else 'Not enough data. ws.Range(targCol & i) = "Not enough data!" End If Next i End Sub Function TimeCounter(time1 As String, time2 As String) As Double 'Returns the number of hours. Dim startHour As Integer Dim endHour As Integer Dim minutes As Integer minutes = 0 startHour = CInt(Left(time1, 2)) endHour = CInt(Left(time2, 2)) If Right(time1, 2) <> "00" Then minutes = minutes + 60 - CInt(Right(time1, 2)) startHour = startHour + 1 End If minutes = minutes + CInt(Right(time2, 2)) TimeCounter = endHour - startHour + (minutes / 60) End Function potatocubed fucked around with this message at 16:40 on Sep 16, 2016 |
# ? Sep 16, 2016 16:37 |
|
potatocubed posted:Alright, paste this into a module and give it a go. That does exactly what I needed, thank you very much! I'm going to have to pick through it at some point and see if I can figure out what makes it tick.
|
# ? Sep 16, 2016 17:17 |
|
This is more of a VBA question than Excel but I'm thinking this thread if my best hope for VBA experts. For work, I'm part of a 25-person committee that makes decisions on certain topics. What I would like to do is create a questionnaire or form of some sort that can reside in an email and be sent out, and the recipients can answer the 5 or so questions with a YES/NO/MAYBE. I'd then need a way to log/track the answers from all the recipients. I have Outlook and Excel 2013 to work with. Any ideas on a simple way to go about this? It looks like there is a simple "Poll" type email that Outlook can do but I think its only good for 1 question. I'm thinking I'll need to create some sort of form with VBA? Hughmoris fucked around with this message at 03:39 on Sep 17, 2016 |
# ? Sep 17, 2016 03:32 |
|
Just use Survey Monkey. Literally the entirely of Corporate America uses it for bullshit one off polls.
|
# ? Sep 17, 2016 04:10 |
|
fosborb posted:Just use Survey Monkey. Literally the entirely of Corporate America uses it for bullshit one off polls. Yeah, Survey Monkey would definitely be the easiest way to go about it. I'd like to try my hand at it as a learning exercise. Am I on the right track, thinking I can build a VBA userform inside an outlook email and the recipients somehow submit their answers back to me?
|
# ? Sep 17, 2016 04:55 |
|
If you're on a committee of 25 it sounds like you're in a larger company. Check to see if you have Microsoft InfoPath. That + SharePoint could probably solve your problem. Link. Otherwise, I think you're SOL. Here's a breakdown of html form functionality by email client.
|
# ? Sep 17, 2016 06:11 |
|
Hughmoris posted:Yeah, Survey Monkey would definitely be the easiest way to go about it. I'd like to try my hand at it as a learning exercise. Am I on the right track, thinking I can build a VBA userform inside an outlook email and the recipients somehow submit their answers back to me? If you really wanted to do this yourself manually you would have to run an HTTP server to host an HTML form which is not something you can do in VBA. Do what fosborb said and try infopath or use something off the shelf like survey monkey. mystes fucked around with this message at 07:37 on Sep 17, 2016 |
# ? Sep 17, 2016 07:35 |
|
Hi guys, not necessarily a small question but figured this is the best place to ask. Any goons looking for a small'ish side project? I'm a chef and I've just taken over a new kitchen, in the past I've either used pen and paper or software like resortkitchen to calculate recipes / stock / produce / kitchen costings etc. Even my self created supplier price lists than show percentage changes on cost of items vs other suppliers is like gold dust in my world. But as for creating a more complete recipe costing spreadsheet, its way beyond me. If anyone is interested then feel free to get in touch at chrisdhegarty at gmail.com & I can expand further & talk If this is frowned upon sorry! Anywhere else I should look?
|
# ? Sep 18, 2016 11:42 |
|
fosborb posted:If you're on a committee of 25 it sounds like you're in a larger company. Check to see if you have Microsoft InfoPath. That + SharePoint could probably solve your problem. Link. mystes posted:Even if this is possible, you definitely should not do this. You should not be emailing random VBA code to people to execute. Also, you would still need a way to receive the answers, and sending an email without user intervention or something like that would be extra terrible. Thanks for the ideas. After thinking about it for a few days, ya'll are right. It isn't worth taking on the headache, and I'll see if others want to use other means.
|
# ? Sep 20, 2016 01:37 |
|
Anyone know why the following isn't working? I have the time "19/08/2016 07:56:57" in cell A1 and elsewhere I have the formula "=COUNTIFS(A1,"<="&A1)" which I expect it to return 1 but it returns 0. If I use a different time e.g. "01/08/2016 08:41:23", then it appears to work fine. Ragingsheep fucked around with this message at 07:08 on Sep 27, 2016 |
# ? Sep 27, 2016 06:27 |
|
Ragingsheep posted:Anyone know why the following isn't working? Probably a dumb question, but do you have your date format set to DD/MM/YYYY and not MM/DD/YYYY?
|
# ? Sep 27, 2016 13:40 |
|
Ragingsheep posted:Anyone know why the following isn't working? Works fine for me?
|
# ? Sep 27, 2016 13:44 |
|
Any time but that one works for me. Change it a second either way? Fine. Separate date and time and compare them separately? Fine. Put them together? Mistake. I'm baffled. Something to do with rounding, maybe?
|
# ? Sep 27, 2016 13:48 |
|
I tried it just now and I get the same result, a 0. Very odd.
|
# ? Sep 27, 2016 13:52 |
|
What exactly are you trying to accomplish? The concat is throwing me off a bit here.
|
# ? Sep 27, 2016 15:16 |
|
Figured it out. Its to do with Excel handling floating point numbers and getting screwed up by me turning the criteria into a string with the concat. Richard Noggin posted:What exactly are you trying to accomplish? The concat is throwing me off a bit here. My data has a set of users and dates and times that the users made a transaction. I wanted to count the number of times more than 5 transactions are made in a hour by a single user. The actual formula is much bigger but this was the bit that wasn't working as intended.
|
# ? Sep 27, 2016 15:36 |
|
Hey cool, an Excel thread. I'm looking for a more efficient way to do something. Let's say I have a bunch of widgets with a shape and color property, and different combinations produce a different part number. In my Excel table, I want to manually enter the color and shape and then have the following cell automatically fill the part number. I figure, I'll have another sheet with a list of the widgets and their properties including color, shape, and part number. Currently, I'm using this code and it works: code:
|
# ? Oct 11, 2016 19:34 |
|
I don't think I'm precisely visualizing what you're doing, but this feels like something you could do with a range-based MATCH function + INDEX instead. See https://www.deskbright.com/excel/index-match-multiple-criteria/ .
|
# ? Oct 11, 2016 22:07 |
|
You can also turn calculations to manual and just F9 after extended data entry.
|
# ? Oct 12, 2016 04:40 |
|
Zorak of Michigan posted:I don't think I'm precisely visualizing what you're doing, but this feels like something you could do with a range-based MATCH function + INDEX instead. See https://www.deskbright.com/excel/index-match-multiple-criteria/ . Yeah, that's exactly it. Match/find with multiple criteria. I'll give this a spin, thanks. fosborb posted:You can also turn calculations to manual and just F9 after extended data entry. Plan B (or C?) right here. Thanks. edit: went with manual calculation because I think, in the end, it's just a lot of cells that have to be calculated with a lot of lookups and that's just going to take time. Oh, well. totalnewbie fucked around with this message at 19:55 on Oct 12, 2016 |
# ? Oct 12, 2016 14:59 |
|
|
# ? Apr 19, 2024 14:51 |
|
How do I turn this: Into this: Obviously this is a very small sample set. I have a few hundred columns to work with in the source data. I'm open to VBA as a solution, but I am not very good with VBA. If you can provide some starting point or lead, I'd very much appreciate it!
|
# ? Oct 13, 2016 23:54 |