|
CellBlock posted:Maybe this is a bigger question and only tangentially related to Excel, but here goes: Well, first, you can specifically lock the formatting and such and only allow users to fill in specific cells. https://support.microsoft.com/en-us/office/protect-a-worksheet-3179efdb-1285-4d49-a9c3-f4ca36276de6 Basically, you set all the cells you want the user to be able to type stuff into to unlocked. Then in the Review tab, turn on both Protect Sheet for all relevant sheets (and uncheck 'Select locked cells', that way users can't even select anything they're not supposed to) and Protect Workbook with whatever passwords you want. Alternatively, have you considered not using Excel for this? Getting a web form set up to collect the data and put it straight into your database seems like a better idea.
|
# ? Jul 2, 2020 17:21 |
|
|
# ? May 24, 2024 19:36 |
|
Karia posted:Alternatively, have you considered not using Excel for this? Getting a web form set up to collect the data and put it straight into your database seems like a better idea. We don't own the files; it's a government entity using them to make digital versions of a paper form to submit for processing. (Currently, they can submit pretty much whatever, and they usually use different spreadsheet formats; the government is just trying to standardize the format so we can read them.) Ideally, we'd probably just use some sort of XML or another data format, but then the users would need software to produce that data format, and everyone already has Excel.
|
# ? Jul 2, 2020 18:33 |
|
If you don't mind programming, then look into editing files through the component object model. You could write a script that could take an excel file, pull out the user inputted cells, insert them into your blank template, then save it out as a validated file. For tasks like this I prefer AutoHotkey, but it could be done in any language .
|
# ? Jul 3, 2020 02:34 |
|
.xlsx is really .zip containing .xml. If you wanted to you could pull out the xml for your sheet and compare known tags I guess. Like you know your template has “<A1>Title</A1>” and compare that to the completed form, repeat for however many you want to check. I’m not smart on how best to do that. In Excel I’ve done something similar in the past that seemed to work. I copied my template to another sheet and then on a third sheet used =Template!A1=Hidden_Template_Copy!A1, copied that formula for all the cells I wanted to make sure were the same, and then at the bottom of the sheet I did =AND(A1:Z1000). If any of the expected values had changed that cell would show as FALSE. Then in I set those two sheets it xlveryhidden so the casual observer will never see them.
|
# ? Jul 3, 2020 05:16 |
|
DRINK ME posted:.xlsx is really .zip containing .xml. If you wanted to you could pull out the xml for your sheet and compare known tags I guess. Like you know your template has “<A1>Title</A1>” and compare that to the completed form, repeat for however many you want to check. I’m not smart on how best to do that. mystes fucked around with this message at 16:48 on Jul 4, 2020 |
# ? Jul 4, 2020 16:44 |
|
I have a massive Excel spreadsheet that I need to normalise. The sheet has 26 columns containing information about users, groups and computers. The typical sheet will have tens of thousands of rows at minimum, potentially up to a few million. A very basic example: code:
Ultimately what I'd like to do is get all this data into some sort of database that is normalised, that is with individual user, group and machine tables each linked by pivot tables. The ultimate goal is to then have the ability to query this database and run analytics, as well as 'browse' the data by quickly looking at, for example, which users are in particular groups, which users have access to particular machines, etc. Can anyone recommend some sort of tool which can help do this? I've tried using PowerShell but this fails completely at large scale. I looked at PowerBI as well but it assumes that the data you want to look at is either already normalised or at least much simpler than what's in my data.
|
# ? Jul 7, 2020 09:54 |
Put that poo poo in a real database. Even SQLite or Access will be better than Excel.
|
|
# ? Jul 7, 2020 11:50 |
|
nielsm posted:Put that poo poo in a real database. Even SQLite or Access will be better than Excel. That's what I'm trying to do. However, I'm stuck with the source data as this giant unwieldy Excel spreadsheet and I can't figure out a good way of doing the conversion.
|
# ? Jul 7, 2020 13:21 |
|
Access has tools for importing excel files. You could also export as a csv, that might be easier to import into some databases.
|
# ? Jul 7, 2020 13:30 |
Initially load the data into Access as-is, then write some queries or VBA to normalize it. Maybe there's also built in tools to turn columns with lists like your groups column into normal form, I never really looked.
|
|
# ? Jul 7, 2020 14:14 |
|
I am trying to make a pivot table which will give the *total* times for each person: Gene 0:11:45 Alex 0:09:14 Mona 0:08:19 Bev 0:08:06 Bev 0:07:48 Fred 0:07:37 Andy 0:07:30 Chris 0:07:27 Sami 0:07:23 Shirley 0:07:08 Fred 0:07:05 Gene 0:06:56 Gene 0:06:52 Naomi 0:06:44 Bev 0:06:25 so that the output shows Bev 22:19 and so on. I know this should be super obvious and easy but I can't seem to hit on the right formula or search term.
|
# ? Jul 10, 2020 20:03 |
Just add the name column as a row field and the time column as a value field in the pivot table. It sums the values per name by default then. Assuming the times are represented as normal time values, that is. If they are text values you'll need to parse them first, do that before making the pivot.
|
|
# ? Jul 10, 2020 20:31 |
|
You are a thing of beauty and a joy forever; that worked perfectly! Thank you.
|
# ? Jul 10, 2020 21:01 |
|
Is there an easy way in VBA to set the value of a cell to the value of VLOOKUP([@column], [table in another workbook], #, FALSE)? I'm looping through a list of tables and want to get rates from a summary table in a completely different workbook without having to do more loops to find the right row. I guess in theory I could just put in the VLOOKUP function I need and then copy/paste as values, but that seems... inelegant.
|
# ? Jul 17, 2020 04:28 |
|
KentuckyFriedBonBon posted:Is there an easy way in VBA to set the value of a cell to the value of VLOOKUP([@column], [table in another workbook], #, FALSE)? I'm looping through a list of tables and want to get rates from a summary table in a completely different workbook without having to do more loops to find the right row. I guess in theory I could just put in the VLOOKUP function I need and then copy/paste as values, but that seems... inelegant.
|
# ? Jul 17, 2020 04:35 |
|
You can use Worksheetfunction.Vlookup in your VBA. Something like this (not in front of Excel so may need correcting): My_lookup_value = worksheetfunction.vlookup(A2,Sheet2!A1:B3,2,0) Range(“A1”) = My_lookup_value The formatting of the formulas in VBA can be a bit weird, I don’t think you need to R1C1 format but maybe add your formula in the cell and then record it as a macro to use in your code. Saves time dicking about with getting the quotes in the right places and whatnot. And yeah, the inelegant solution works fine to: A1 = vlookup A1.copy A1.pastespecial as value —- edit: Half an hour later a little voice in my brain told me I was stupid, this would be much simpler: Range(“A1”) = worksheetfunction.vlookup(A2,Sheet2!A1:B3,2,0) DRINK ME fucked around with this message at 05:32 on Jul 17, 2020 |
# ? Jul 17, 2020 05:09 |
|
Microsoft has apparently added support to Power Automate that allows it to run Excel javascript scripts outside of an interactive Excel session (previously they would just run in desktop Excel or your own browser in the online version). I don't think anyone will actually use this because nobody uses power automate and right now it sounds like this has to be specifically enabled, but if it works this could potentially be MUCH more reliable than using VBA or COM with desktop Excel.
|
# ? Jul 18, 2020 19:56 |
|
I'm trying to create a dropdown list for cells based on a column. Normally, this isn't a big deal, you go to Data Validation, allow list, select range, and BAM, everything works. I'm not sure what I'm missing, but when I check the "Ignore Blank" box, it still includes blanks in my list: Created Data Validation dropdown: Data Validation Settings: Data table pulling from:
|
# ? Jul 22, 2020 22:31 |
|
raej posted:I'm trying to create a dropdown list for cells based on a column. Normally, this isn't a big deal, you go to Data Validation, allow list, select range, and BAM, everything works.
|
# ? Jul 23, 2020 02:24 |
|
Yeah looks to be way more complex than it should be. Found this https://www.youtube.com/watch?v=6PcF04bTSOM
|
# ? Jul 23, 2020 02:36 |
|
Harminoff posted:Yeah looks to be way more complex than it should be. Found this Holy wow. Great find there. This should do the trick in my overly complicated spreadsheet of dynamicness. Thanks!
|
# ? Jul 23, 2020 03:26 |
|
At some point one of my pivot tables seems to have turned into a power pivot table, which means now all my GETPIVOTDATA functions that used that table are borked. :1 Basically I had a cell that looked like this:code:
code:
Also I forgot to post and say so but application.vlookup totally worked in solving my previous problem.
|
# ? Jul 27, 2020 22:00 |
|
How do I make an array of sliders always sum to 100%? Something kinda like how Humble Bundle lets you distribute your donation. I'm looking to forecast profits with different sales distributions. So far I have a SUMPRODUCT of my different SKUs profitability as a percentage and some arbitrary weights. I just want to be able to futz about with the weighting and have it sanity check me that it adds to 100% when I hit submit or something.
|
# ? Aug 11, 2020 07:04 |
|
Just gonna keep asking questions and maybe one day they'll be answered. How do I like "future proof" my summary/aggregate sheet? Right now I have the first sheet in the book that is pricing and aggregate sales and the next sheet is sales for August. How do I make a formula that calls August sales and each subsequent month and sums them without having to rewrite my formula for the front page every time?
|
# ? Aug 13, 2020 15:14 |
Uh probably something with INDIRECT and matrix formulas, I'm not sure if there is a good way to detect what sheet names exist. You may need to at the very least maintain a table of the sheet names/other identities to use.
|
|
# ? Aug 13, 2020 15:26 |
|
nielsm posted:Uh probably something with INDIRECT and matrix formulas, I'm not sure if there is a good way to detect what sheet names exist. You may need to at the very least maintain a table of the sheet names/other identities to use. I've decided that I'm just going to bound it to the calendar year for this book and then I'll figure out how to call between books for a multiyear aggregate book later on. I have a table of sheet references for the rest of the months of the year now, but the way my INDIRECT is written it doesn't increment down the column when I drag like I want it to. code:
Edit: I tried using a CELL function because that's what I found on Google and it doesn't work. Points at the sheet it is on rather than the one I'm trying to point the indirect at. code:
Papa Was A Video Toaster fucked around with this message at 16:37 on Aug 13, 2020 |
# ? Aug 13, 2020 16:08 |
|
I looked up how INDIRECT works so i could try and understand what you're trying to do and how. It looks like it needs to use a worksheet name that it references from another cell https://www.excel-easy.com/examples/indirect.html https://www.contextures.com/xlFunctions05.html I did find a way to use a formula to generate a list of worksheet names at HowtoExcel.org: quote:1. Go to the Formulas tab. Now you need a count of how many worksheets are in the book, or assume a max amount and add some functionality to hide index values that don't exist.
|
# ? Aug 13, 2020 17:06 |
|
So it turns out I was kinda right with the quotes thing. code:
|
# ? Aug 13, 2020 17:17 |
|
How do I save a selection? I have a bunch of dummy data I copied across my sheets to do the testing that I now want to clear. It's all in exactly the same areas. Also how do add a new row across multiple sheets? Edit: both questions had the same answer. Select multiple sheets with Shift. Papa Was A Video Toaster fucked around with this message at 17:43 on Aug 13, 2020 |
# ? Aug 13, 2020 17:35 |
|
I have an IF statement that should be pretty straightforward but doesn't seem to be working for the value_if_false part. =IF(MATCH(serial number, column of serial numbers to check against, 0), "Match", "No Match") The "Match" works but if I enter a non matching serial number, or anything other than a number from the column of numbers being looked up, the cell remains at #N/A. What might be going wrong here?
|
# ? Aug 26, 2020 19:03 |
|
hummingbird hoedown posted:I have an IF statement that should be pretty straightforward but doesn't seem to be working for the value_if_false part. If MATCH can't find a match, it returns #N/A. You either want to use COUNTIF(column, serial number)>0 or wrap the MATCH in an ISNA instead.
|
# ? Aug 26, 2020 21:06 |
hummingbird hoedown posted:I have an IF statement that should be pretty straightforward but doesn't seem to be working for the value_if_false part. IF can only work if the first argument evaluates to TRUE or FALSE (or [any number but 0] or 0, same thing). Using ISNA will let you make MATCH do that. I would just make the NA condition of ISNA return 0.
|
|
# ? Aug 26, 2020 21:36 |
|
The above advice worked. Thank you! The last piece to this project I can't do on my own deals with switching cells. I want to be able to scan a barcode (column a) then tab over to column b to scan a status from a reference sheet of barcodes. Then I'd like the active cell to jump back to column a of the row under the active row. I can program the barcode scanner to send the tab key after a decode, so going from column a to b is not a problem. I don't know how to write a macro that would send the active cell to column a on the row under the active row after a tab character.
|
# ? Aug 30, 2020 15:54 |
|
If I’m reading that correctly: when a value is entered in column B, move to the next row on column A? You could do something like this in the worksheet code code:
The next line checks we’re in column B (column 2). If we are then the current cell is offset by 1 row and -1 columns (the next row in column A). DRINK ME fucked around with this message at 23:04 on Aug 30, 2020 |
# ? Aug 30, 2020 23:02 |
|
DRINK ME posted:If I’m reading that correctly: when a value is entered in column B, move to the next row on column A? Thanks for the help. I just got around to trying this out but nothing happened. When column B is active, I populate a cell in it, then do anything else, the selected cell behaves as it normally does(Enter moves the active cell on row down, Tab moves the active cell one column to the right, etc.)
|
# ? Sep 13, 2020 12:48 |
|
This is tangentially related to Excel and the O365 ecosytstem, not sure of a better thread to put this in. Has anyone used Microsoft Flow / Power Automate? I just discovered it, and am currently a solution looking for a problem. I'm looking at my daily/weekly tasks and seeing how I can use it to automate some Excel -> Outlook -> OneNote flows.
|
# ? Sep 13, 2020 19:19 |
|
Hughmoris posted:This is tangentially related to Excel and the O365 ecosytstem, not sure of a better thread to put this in. The beta functionality to run Excel scripts seems like it could be interesting but it only works in the business version and it needs to be specifically enabled. In general I'd prefer to use something else if possible, but it's probably one of the easiest ways to interact with outlook/o356 and if it works I'd much rather try to use the excel script functionality than vba/com for anything automated. mystes fucked around with this message at 19:34 on Sep 13, 2020 |
# ? Sep 13, 2020 19:28 |
|
It also only works with excel online files, mostly with just tables too if I remember correctly. I have to do some dumb poo poo like have excel scrape data from multiple workbooks using vba, compile it and send a report using vba yo email, then upload some stats to SharePoint using vba so that I can create power bi dashboards using that data. Pretty crazy and I'm sure there is a better way to do it. Hopefully office script can help with some of it.
|
# ? Sep 13, 2020 21:06 |
|
hummingbird hoedown posted:Thanks for the help. I just got around to trying this out but nothing happened. When column B is active, I populate a cell in it, then do anything else, the selected cell behaves as it normally does(Enter moves the active cell on row down, Tab moves the active cell one column to the right, etc.) Weird stuff. Check you have macro/code enabled. Check you have added it to the worksheet you are using - this needs to be against the sheet, if you look at the project browser in the code view / vba there will be Microsoft Excel Objects and your list of sheets. Pick the sheet you are using and add it there. A good way to check if it is firing or not would be to add something visual to the code. Like in the first line add msgbox “code fired” and then go change a value in column B. If it’s working it should give you a message box pop up.
|
# ? Sep 13, 2020 23:44 |
|
|
# ? May 24, 2024 19:36 |
|
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) This is for predictions, and I'd like to run a Monte Carlo experiment on it: do it, say, 5000 times with different weights. The trouble is I can't figure out how to constrain the weights. At the very least, I'd need them all to sum to 1, and I can't do that by just multiplying by RAND(). I could approximate it by doing RANDBETWEEN() (and dividing by 100) but that could still be quite a bit off in either direction. I searched online and most of the solutions I found were to make five of them random and the sixth 1 minus the sum of the other multipliers, which won't work for me; not only am I not sure offhand how to write that formula so that it works 5000 times, but also, if I'm doing this 5000 times, many of those 1-SUMs will end up negative. Is the RANDBETWEEN method my best option, or is there a smarter way to do this?
|
# ? Sep 28, 2020 13:30 |