|
schmagekie posted:You can take the column of what you're trying to grab. =VLOOKUP($A2,Data!$A:$J,COLUMN(Data!B2),0) =VLOOKUP($A2,Data!$C:$J,COLUMN(Data!D2)-COLUMN(Data!$C2)+1,FALSE) The +1 is necessary. Or just use Index & Match.
|
# ¿ Sep 23, 2014 17:54 |
|
|
# ¿ Apr 28, 2024 06:15 |
|
So I have a semi-advanced question. We've been maintaining an .xlsm workbook, and some of the tabs in the worksheet are "Very Hidden". That is, we set the tab properties in VBA to have visibility 2. Users can pull data from a "very hidden" sheet, and it's completely unencrypted, but you can't actually unhide the sheet and see it. There is a password on the VBA project (so you can't unhide via VBA), but the workbook is otherwise unprotected. The person who maintained the sheet left the company, and he was the only one who actually knew the VBA password. Is there a way to unhide these sheets and/or crack the VBA password to make the workbook useful again? I have a feeling it's possible since the contents of the hidden sheets are completely unencrypted.
|
# ¿ Feb 4, 2015 22:52 |
|
ShimaTetsuo posted:Unless I did it wrong just now, can't you just open a new workbook, and run code in the new workbook to unhide the sheet in your first workbook? It seems to work fine. Yeah this worked. Thanks!
|
# ¿ Feb 5, 2015 14:04 |
|
kapalama posted:Excel formatting question: Do you have any issues using conditional formatting? You can have the formula in your cells equal the running total in each row, then set the font of the text to white when it's the same as the row above it in order to make it invisible.
|
# ¿ Sep 23, 2015 17:05 |
|
Turkeybone posted:
You're using conditional formatting data bars for this? Both of the solutions that I can think of either require VBA or are very messy. (1) You could have the top row fill up 42% of the way by setting the minimum bar length to Number=0 and the maximum to Number = 78/(33/78). This makes it think the maximum bar length is 184.36, and 78 is 42% of this which leads to the bar being filled up 42%. However, due to the limitations of excel it doesn't appear you can use relative references for width of the bars, so this conditional format only works for a single row you specify. You could use a macro to set up a conditional format for each cell using the function: .MaxPoint.Modify newtype:=xlConditionValueNumber, newvalue:= [insert a formula here] (2) Another option is to split up your second column into 100 columns that are 1-2 pixels wide, then conditionally format them that way.
|
# ¿ Oct 15, 2015 22:34 |
|
Turkeybone posted:Yeah, it's going to change as progress occurs each day, so while those are all cool answers, it's going to fall into "too much work for this one thing." Too bad I can't use relative references for it. You could modify the macro solution I posted to update automatically whenever the sheet updates. It would take a VBA expert like 15 minutes to make the whole thing, but even a beginner should be able to get it done within a few hours. It's up to you whether that's worth it.
|
# ¿ Oct 16, 2015 14:06 |
|
nielsm posted:I have a bunch of data items, each item has a starting time and an ending time, but otherwise there isn't any particular distinguishing features or values of each item. There is overlap between items. I'd like to make some sort of visualization of this, that emphasizes the overlapping. If you don't have too many points, like maybe under 100, a Gantt Chart might work. You could also make a line graph, with the height being the number of simultaneous projects going on. Or you could combine the two of them into one chart.
|
# ¿ Oct 26, 2015 16:35 |
|
raej posted:Another weird one. I have a cell that's calculating a duration based on GetCurrentTimeEST()-<another cell>. When I change anything on the other cell, the formula recalculates (good). When I change any other cell on the form, the duration does not re-calculate (bad). Mark the custom formula GetCurrentTimeEST() as volatile. I believe you just put "Application.Volatile" in the function code.
|
# ¿ Nov 19, 2015 23:36 |
|
Xandu posted:Anyone ever taken an excel test for a job interview? I know pivot tables and vlookups and I'm generally pretty competent in excel outside of VBA, but I'm not really sure what to expect. Any particular things to study up on? Hard to say without more context, but these are often pretty important in an analysis position: Autofilter and sorting Absolute vs. relative references SUMIF() and COUNTIF() The basics of SUMPRODUCT() and array formulas Named ranges Goal seek (If it's financial) A lot of the financial functions, particularly PMT(), PV(), FV(), IRR(), NPV() Also formatting - if they want an example work product instead of just an answer make all your results clean and readable If I were performing the test I would also be watching you to see if you utilize keyboard shortcuts or navigate with the mouse (more shortcuts, less mouse is better).
|
# ¿ Apr 7, 2016 18:43 |
|
Squashy Nipples posted:I would argue that there are VERY few things that you can do with Array Formulas that you can't do with CountIf(s), SumIf(s), and the like. That said, knowing how to use Array Formulas is still impressive. TRANSPOSE() is super useful and MMULT() sometimes is a time saver. The really useful thing that array formulas can do is a custom operation on the subset of numbers using custom criteria - such as finding the median, max, or min, or using the LARGE() and SMALL() functions. Array formulas are also easier to update and maintain than COUNTIFS() and SUMIFS() since array formulas can use regular IF() statement logic instead of being forced to use kludgy text based formulas like =SUMIF(A:A, ">"& C5, B:B) When you could use {=SUM( IF(A:A>C5, B:B, 0) )}
|
# ¿ Apr 7, 2016 20:08 |
|
Alfalfa posted:I believe that works perfectly. It's a bit hacky, but you can 1) Change your fomula to D2:T2 2) Put something blank or arbitrary in column D that won't impact your formulas 2) Hide Column D 3) When you insert columns, insert before column E The hard part is step 2, and making sure that whatever you put in column D won't affect your formulas.
|
# ¿ Apr 18, 2016 16:33 |
|
huhu posted:I have a web app that exports CSV files for the end user to download and print. However when they open the CSV file in Excel it strips off zeros for float values, I'd like there to be column widths, etc. Obviously that's not how CSV works. Is there a way to setup some kind of template for importing CSVs or am I better off having Python spit out Excel files instead which have already been formatted? You can write a macro that imports a CSV, keeps leading 0's and formats the sheets correctly, but you'd have to train users to push a custom button and navigate to the file instead of just double clicking on it. If you record a macro using the Data->From Text wizard it'll give you a good idea of the commands you need. esquilax fucked around with this message at 19:37 on Jul 21, 2017 |
# ¿ Jul 21, 2017 19:35 |
|
ShimaTetsuo posted:Good luck convincing your users to run some random VBA code on their machine. It's also completely pointless: you already have code as part of your web app (in Python or whatever) that generates the CSV file, why would you go and create a second application in VBA to finish the job? Just output the file in one step. I assumed by the statement "template for importing CSVs" that he had some leeway in how users use the program. I certainly have sent random VBA code to clients to help them format worksheets.
|
# ¿ Jul 21, 2017 20:53 |
|
Sad Panda posted:A student gets a level 9, their below target is 1-4, good is 5-6 and excellent is 7-9. The spreadsheet should see this and say "Excellent". I've come up with 2 solutions for this so far. If you use a vlookup with "true" instead of "false" then it will match the highest value that doesn't exceed your lookup number. So a table like: 0 Below Target 5 Good 7 Excellent A vlookup will take a numeric score like 5.25, and will look it up on the table to output the words. You could also do this via an index(match()) with a match type of 1, sort of like how you did. But generally just having a table in a hidden column off to the right is the best move here. esquilax fucked around with this message at 18:58 on Apr 7, 2019 |
# ¿ Apr 7, 2019 18:54 |
|
I have a group of data. I want to round each number to the nearest whole number, but also maintain the sum. This is often mathematically impossible but I'm trying my best. e.g. my data set totals to 14 and is: code:
code:
|
# ¿ Oct 9, 2019 21:19 |
|
Because 1) the calculations need to work off of the rounded numbers, and 2) the little numbers that are visually shown on the page need to add up to the big number that is shown on the page, otherwise people get mad that the numbers don't add up.
|
# ¿ Oct 10, 2019 03:25 |
|
fosborb posted:oh!, then array formulas are your friend The total needs to remain unchanged. For background, I have a group of people that are migrating into different buckets. There are (for example) 100 people in the initial sample, and I want a third to go to each of three buckets. Normally this would result in 33.33 (repeating of course) people going into each bucket. Normally I am ok talking about partial people, but but as a requirement of this model, partial people do not exist. So I need to make sure that the model can automatically put 34 in one bucket and 33 in the other two buckets so that we don't lose anyone and the numbers add up. And I also need to make sure the calculations that work off of those migrated counts use the 34/33/33 numbers and not off of 33.333 people. And this model will be used going forward, so it needs to be flexible to work with an variable number of buckets, variable migration assumptions, and a variable number of initial people. I have already made an algorithm to do this via a 5 step process, but am wondering if there's a better way to do it that would have been easier, or is less computationally intensive.
|
# ¿ Oct 10, 2019 03:43 |
|
fosborb posted:Is the sum of the original numbers always going to equal a whole number? Yes. I am starting with a whole number of people and it will end up as a whole number of people.
|
# ¿ Oct 10, 2019 03:53 |
|
Jethro posted:Are you just trying to determine how many whole people to put in each bucket, or are you also doing calculations that need to do weird rounding? Like, your first example was an arbitrary set of numbers that happened to total to a whole number, but then you pivoted to putting M people in N buckets of approximately size M/N. If you're just bucketing, and you want the buckets to all be as close to equal as possible, then you have MOD(People,Buckets) Buckets of size CEILING.MATH(People/Buckets) and (Buckets-MOD(People,Buckets)) Buckets of size FLOOR.MATH(People/Buckets). It means the buckets can be any size. The second example was a simplified version. In my initial example it started with 14 people (calculated based on a data intake, but it will always be a whole number) and the migration assumptions were 20.0% /31.429% /31.071% /17.5% (input by the user, in normal usage will typically be a multiple of 5%, from 0% to 100%, and it will always sum to 100%). This was my solution which can be generalized. Paste into cell A1, and do text-to-columns using the vertical bar delimiter "|". In the actual model B2:B5 would be formula driven. code:
|
# ¿ Oct 10, 2019 18:56 |
|
disaster pastor posted:I'm currently using a very basic formula for weighted averages: (B2*0.1)+(C2*0.1)+(D2*0.1)+(E2*0.2)+(F2*0.25)+(J2*0.25) The quick and dirty method is to generate each random number individually then scale them all together at the end to sum to one. E.g. You generate a "first set" of random numbers based on your chosen method. [0.08, 0.1, 0.05, 0.2, 0.25, 0.3] Which sums to 0.98. Divide each element by 0.98 to generate a second set of random numbers: [0.816, 0.102 ...] Then you ignore the first set of random numbers (which doesn't sum to 1), and use the second set (which does to 1) as your weights. The way to implement it in excel is to use a bunch of columns off to the right for each row, or use a macro. I couldn't gather from your post whether each weight is uniform from 0-100% or if it is constrained in some way (e.g. weight on B is expected to be normal with mean 0.1 and stdev 0.02) but this method works under any approach to generating the random weights. Note that this is not mathematically rigorous and probably would not fly in an academic setting - it takes whatever probability distributions you start out with and "tweaks" them in order to fit into the constraints.
|
# ¿ Sep 28, 2020 14:56 |
|
In that case, one caveat from my method is that the tweaks it does to probability distributions might generate weights outside of your range. E.g. if your randbetween() is designed to constrain the B weight randomly between 0.05 and 0.15, it might end up using something like 0.04 or 0.18 (which would be outside of the 0.05 to 0.15 range). It sounds like that's ok based on what you've said.
|
# ¿ Sep 28, 2020 17:42 |
|
me your dad posted:I'm losing my mind with dates. I have a column displaying dates in mm/dd/yyyy. Excel views the values 1, 3, and 2020 as those dates. You can use the day(), month() and year() functions as previously suggested, or just change the formatting on those columns. To do this, you can use the Home->Number dropdown menu to on those three columns change the format from "Date" to either "Number" or "General". The shortcut for this is Ctrl+Shift+~
|
# ¿ Nov 3, 2020 18:02 |
|
Rabbit Hill posted:I have a big spreadsheet which was set up in a clumsy manner, the biggest problem being that it combines two variables in single columns. I want to separate these columns of combined variables into separate columns. There might be a way to use sumifs or index/match, but an array formula is the easiest way for me. I'll call the first chart "ugly" and the second one "neat" Step 1: Add "helper" rows to the top or bottom of the ugly table. For example, if you insert rows above, column B would have "Agency #1" in B1 and "Murder" in B2. This should match the labels you use in the neat table. Step 2: Build your neat table. Step 3: Create a formula to pull the numbers based on each column as your criteria. If for example, the "Year" label of the ugly chart started in A3, with your helper labels above in rows 1 and 2, your formula for the first row would be something like: =sum(if((Neat!A2=Ugly!$A$4:$A$6)*(Neat!B2=Ugly!$B$2:$J$2)*(Neat!C2=Ugly!$B$3:$J$3), $B$4:J$6, 0)) Step 4: Press Ctrl+Shift+Enter to turn that formula into an array formula Step 5: Copy that formula down to the other columns The formula in step 3 basically applies all 3 criteria to the ugly chart to find which numbers to pull. The multiplication is just a way to do an "AND" function, and the fact that it sums doesn't matter since it's only pulling a single number for each.
|
# ¿ Feb 2, 2022 20:42 |
|
Mak0rz posted:So have a column of dates. I want Excel to highlight entries that are a year or more old. Yes, that reply is correct. What you need to do is change the conditional formatting formula to something like: code:
edit: This basically the same response as what you got in the math thread esquilax fucked around with this message at 03:14 on Apr 28, 2022 |
# ¿ Apr 28, 2022 03:12 |
|
Mak0rz posted:That worked, thank you. Don't forget leap years!
|
# ¿ Apr 28, 2022 19:43 |
|
it dont matter posted:Can I ask a Google Sheets question here? Yes. In the conditional formula menu, choose "Custom Formula Is" and set it to something like: =and((A2="YES"),(B2="NO")) And the range should be your data in Column B. The custom formula you use should be the relevant formula for the top left cell of the conditional formatting range - the formula I wrote above was if cell B2 is the top of your data range. esquilax fucked around with this message at 14:37 on Oct 25, 2022 |
# ¿ Oct 25, 2022 14:34 |
|
it dont matter posted:Yes that worked, thank you. You can use ISBLANK(B2) or something like: B2="" You could implement that either by rewriting the first conditional formula to account for both No and [blank], or add a second conditional formatting formula.
|
# ¿ Oct 25, 2022 15:23 |
|
Lib and let die posted:Here's an incredibly dumb question: Highlight the cells you want to fit the columns to. Home->Cells->Format->Autofit Column Width Alt->h->o->i is the alt key shortcut I think it messes up if you use word wrap.
|
# ¿ Nov 8, 2022 21:23 |
|
FreshFeesh posted:I would like to average all numbers where any of the following columns contain particular words, but my use of AVERAGEIF was giving me results that were way off (divide by zero errors, answers 1/4th expected values, et cetera). Is there a reasonable/rational way to match/average values based on the contents of multiple columns? In general, instead of AVERAGEIF you are probably better off doing a SUMIF divided by a COUNTIF. Does this solve your problem? It should only return a Div/0 error when you try to average a Result that doesn't exist in the data. There are other ways that are a little more scalable but this is probably simplest with what you have already built.
|
# ¿ May 4, 2023 16:28 |
|
FreshFeesh posted:Unfortunately SUMIF provides weird results too when I call it across a range of columns. Oh, I was assuming you were already using a formula for each column on your AVERAGEIF functions the way that HootTheOwl is suggesting that you do. Yeah neither AVERAGEIF or SUMIF play nicely wth a criteria array that is a different size than the sum array.
|
# ¿ May 4, 2023 16:54 |
|
You can use the =INDIRECT() function, and all you need to do is put your tab names in the first column, either via formula or any other method. The =INDIRECT() formulas should also all copy down fine.code:
|
# ¿ Jun 22, 2023 01:35 |
|
Ideal Paradigm posted:Is there a way to filter a set of values from one sheet and apply it to two other sheets in the same workbook? Are there any issues with adding in a hidden dummy column on Sheet 1 and Sheet 2 that reads Y/N based on whether the ID appears in Sheet 3? You can do this using an If(iserror(vlookup())) formula. Vlookup returns an error, if the value you are trying to find doesn't exist in the lookup table.
|
# ¿ Nov 23, 2023 13:22 |
|
Ideal Paradigm posted:
Your intent though is that since person with ID 1002 is listed at least once in Sheet 3, that it is a valid ID and any/all rows for person 1002 should be shown in Sheets 1 and 2? That's what the method I suggested does.
|
# ¿ Nov 23, 2023 22:24 |
|
HootTheOwl posted:It shouldn't be evaluating the day difference to 24, it should be evaluating it to 1. I do not know why for you it is evaluating it that way in yours. Change E30 to 11/28/23. Does it still say 2 hours? It's giving you the "right answer" because it is formatted as h:mm, which drops the number of days from the cell. If you change formatting to something custom like yyyy:mm:dd:hh:mm, you can see that the cell value is being treated in excel as January 23 1900, @ 2 AM. [h]:mm gives the elapsed number of hours. Your formula is essentially telling excel to take 1/0/1900, add 24 days, add 1/24 days , and subtract 23/24 days. Doing direct math on date and time values is a minefield of these kinds of errors, especially if you are importing data or manually entering it. It's best practice to use functions like hour() and do the math directly. esquilax fucked around with this message at 16:46 on Nov 28, 2023 |
# ¿ Nov 28, 2023 16:31 |
|
|
# ¿ Apr 28, 2024 06:15 |
|
I have a very kludgy solution using pivot tables, until someone else posts something better. Create a new column, and translate your version number into a value, such that the most recent version is the highest number. We can call this column VersionValue. Be make sure you include sufficient leading zeroes for this translation, in case your versions go up to 1.10.100 or something with a different number of digits. e.g. 1.1.100 translates to 1001100 1.2.100 translates to 1002100 You can then make a pivot table using Device and Version as rows, and VersionValue as values. Set VersionValue to summarize values as "Max". Then set a filter on the Version field, using the Top 1 by Max of VersionValues. This is part of the Filters->Top 10 right click menu. If you then set the pivot table to "Show in Tabular Form" and hide any subtotals, it's easier to copy and paste out.
|
# ¿ Mar 11, 2024 22:59 |