|
Can index and match be conditional? Like lets say I have some arbitray number of rows and two columns A and B. Can I then add a third column and using index and match have column C equal to some concatination of every row where B is equal to the A on the specific row I'm working on? code:
code:
|
# ¿ Mar 3, 2022 04:12 |
|
|
# ¿ Apr 28, 2024 19:50 |
|
Lib and let die posted:And then when I re-open the file to work with it, I have to convert it all to text again else it saves dates in whatever hosed up format it's decided is best. I suppose I could macrofy it, but then I have to have a workbook with my macros in it open when I'm working with the files too...It's absolutely infuriating. I'm close to giving up on Excel entirely and seeing if Google Sheets handles them any better - I've tried about everything I can think of with Excel (hence turning to my fellow goons for advice) Turn off automformating? Past values only?
|
# ¿ Mar 3, 2022 17:31 |
|
Sounds like you want CountIfs
|
# ¿ Mar 24, 2022 16:42 |
|
Falconier111 posted:
Use a code tag E I can't tell on my phone what you're looking for HootTheOwl fucked around with this message at 01:39 on Mar 25, 2022 |
# ¿ Mar 25, 2022 01:27 |
|
Ok I'm at my computer and I think you overthought it: First, format your input into an array of strings so it's on per line. It looks like you have this already but in case you don't, use the Split function to achieve this. Then define an output array of strings Then, run a For Each loop over the split input array, with each line being an element in the group. Inside this loop: If The output array is empty, add the current line to the output, except the last character (which should be a ") Next If the output array wasn't empty, then check the first character in the Line. If the line begins with a " then concatinate it onto the last element in the output array (remember to remove the leading and trailing " characters) Else, concatenate a " character onto the last element in the output array. And then Add the current line as a new element into the output array, removing it's trailing " Next, End For My VBA is pretty rusty but it should look something like: code:
HootTheOwl fucked around with this message at 02:43 on Mar 25, 2022 |
# ¿ Mar 25, 2022 02:31 |
|
My wife says you want a pivot table.
|
# ¿ Jul 21, 2022 00:50 |
|
Lib and let die posted:I don't understand lambdas in python, and I don't understand them in excel. why create a function that's just getting thrown away??????? Lambdas let you define your own function ad hoc and they're amazing and cool and they're my friend.
|
# ¿ Jul 21, 2022 13:44 |
|
Looten Plunder posted:I'm creating an agent performance dashboard at work. I run a report and paste the data in excel then have a dashboard that summarises it by employee. I have a bunch of rules that filters based on the employee name that's input into cell B3. I currently have the following macro for filtering a pivot table based on the employee name in B3 to show the assessments that were completed for them So you're only ending your if block. I think you want return there instead.
|
# ¿ Jul 21, 2022 13:50 |
|
Nested ifs and concatenation Sorry, I thinki misunderstood what you asked for: I would try for a macro
|
# ¿ Jul 23, 2022 21:24 |
|
Looten Plunder posted:I'm trying to create a macro to copy a worksheet, create a new document with a filename based on the value in A3, paste the worksheet with just the values, columnwidths and cell formatting. First, your filepath is wrong: you're missing the slash between test folder and cell A3 (A2?) Second I don't believe you can call .activate a workbook that isn't open E: third, save as is going to make a complete copy of your work book, no? There's got to be a better way to do that. HootTheOwl fucked around with this message at 04:31 on Jul 25, 2022 |
# ¿ Jul 25, 2022 04:27 |
|
Try nesting ISBLANK into your filter condition Or, more easily: <> "" (Not equal to emptyquote) HootTheOwl fucked around with this message at 23:50 on Jul 26, 2022 |
# ¿ Jul 26, 2022 23:45 |
|
neogeo0823 posted:Wouldn't that result in the empty cells being excluded from the FILTER, and thus not getting pasted over to the result area? Or am I reading it wrong? Right. Sorry I meant: In your filter you basically have two outputs: The desired one and then a special branch if the value is blank. code:
HootTheOwl fucked around with this message at 01:40 on Jul 27, 2022 |
# ¿ Jul 27, 2022 01:36 |
|
A lambda But also 0 is just what index/match returns when the cell is blank, so you might need to just manually assign all 0's as blanks. Of course this won't work if zero is an acceptable value.
|
# ¿ Jul 27, 2022 02:20 |
|
And Autofit is enabled?
|
# ¿ Jul 28, 2022 13:41 |
|
neogeo0823 posted:I'm not sure how to enable it, and Google isn't helping much. I know that when I click the autofit button, it seems to work, but I don't see an option to turn it off or on. Microsoft support says posted:On the Home tab, in the Cells group, click Format. Under Cell Size, click AutoFit Row Height. Tip: To quickly autofit all rows on the worksheet, click the Select All button, and then double-click the boundary below one of the row headings.
|
# ¿ Jul 28, 2022 17:10 |
|
If you already have a macro.... solve the whole workbook with a macro
|
# ¿ Jul 28, 2022 19:52 |
|
Sounds like you want to perform a VLOOKUP on column B using the values on column A something like code:
|
# ¿ Jul 28, 2022 21:06 |
|
Coward.
|
# ¿ Jul 28, 2022 21:07 |
|
Looten Plunder posted:I work at a call centre where Managers have to assess their agents and write comments to justify how they scored the agent. I'm trying to create a pivot table that calculates the percentage of times a manager made a selection but didn't write a comment. Can you add an extra column with a formula that uses COUNTBLANK?
|
# ¿ Sep 1, 2022 14:47 |
|
My wife is working on a big sheet that should be a database. Does excel have a way to index 11,000 rows so it doesn't take a hundred years when you try nd sort it?
|
# ¿ Sep 13, 2022 23:17 |
|
fosborb posted:11,000 rows shouldn't take any time at all to sort. if it does, try turning off calculations and manually refresh after sorting What if the cell is create via a forumula?
|
# ¿ Sep 14, 2022 00:14 |
|
AG3 posted:I'm using a VBA code I googled to alter the enter key behavior for my sheet, to make it move right by default instead of down. The problem is, this code affects Excel permanently even in other files and persists through Excel restarts, until I manually run the code again to toggle it off. It looks like this: I'm looking it up, but you're applying your change to the application object (excel) when it sounds like you only want to apply it to she worksheet, which I don't think you can do. Basically you're changing a setting in excel which is why it applies to your other sheets. It's not actually a change to the workbook, but to excel itself. I also don't think you can use macros to tap into .net events (Ie, When the application closes, do something) But I also think you can use windows built in language hotkeys? e: Yup, this can only be done to applications: https://learn.microsoft.com/en-us/office/vba/api/excel.application.moveafterreturndirection e: Oh! You can have macros run at prescribed events as documented here oh and there's event handlers too! Ok, give me some time and I think I can do this to you. If you want to do it yourself read this: https://www.exceltip.com/events-in-vba/workbook-events-using-vba-in-microsoft-excel.html Looks like you can just slap these into your workbook. I wonder if this means you can have a macro which then just updates these handlers for you too? EEE: Use the activate and deactivate events, imo. This will change the setting every time you enter the sheet and again when you leave it HootTheOwl fucked around with this message at 13:41 on Oct 13, 2022 |
# ¿ Oct 13, 2022 13:25 |
|
Chickpea Roar posted:What do you mean? You shouldn't have to do any copy/pasting, unless I've misunderstood something about the problem. When they said copy past the values, they meant to strip out the formulas for sorting. E: Sorry I hadn't had my morning coffee yet and posted this because it took me a minute to understand the connection between what DRINK ME was saying in their two posts. They already said this.
|
# ¿ Oct 25, 2022 12:40 |
|
it dont matter posted:Yes that worked, thank you. Have it be red by default and only turn green when it's yes
|
# ¿ Oct 25, 2022 15:20 |
|
Jack the Lad posted:Is there a way to write the name of a named range as text in a cell, then pass the contents of that cell to a formula that parses it as the named range? this sounds like a lambda.
|
# ¿ Nov 8, 2022 01:37 |
|
Lib and let die posted:Here's an incredibly dumb question: A macro which looks at the length of each column, counts the number of characters in the column and makes a guess based on the average kerning.
|
# ¿ Nov 8, 2022 20:26 |
|
The vba code should just be one line, every column has a column width property and you can just set that to shut number, and if you want them all equal then you just feed column A's width as the argument
|
# ¿ Nov 9, 2022 05:38 |
|
Kibayasu posted:Assuming I put this in the right place it gives me a Run time 1004 error whenever I enter or delete anything in B1. I think your problem is that you have no error checking on your set. What if xPTable couldn't find depots? What if xPFile couldn't find the pivot fields? What if the target had no test? It's combersome but refactor your code to only advance if the value is found. This will make debugging easier. code:
or better, use therror handling I added HootTheOwl fucked around with this message at 18:44 on Nov 10, 2022 |
# ¿ Nov 10, 2022 18:41 |
|
After you get that to compile and run (I typed it free hand, so there could by typos and syntax errors that VS would find), add a messagebox to the handling section so you can track which line failed. Just have a string defined as 'nothing' and then after every action you're worried about change the value to 'did X, now trying Y' and then you'll have it. If it's actually truly not erroring, then you're probably not getting the correct values assigned.
|
# ¿ Nov 10, 2022 18:51 |
|
Kibayasu posted:I really appreciate the help! Though if I wasn't clear I have 0 knowledge about VBA and if I ever need it just hope that someone on the internet has posted about precisely what I need and that just copying/pasting the code will work. I wouldn't have the first idea on how to do what you've suggested here, which makes it even more awkward asking for VBA help. That's good to know about "On Error Resume Next" though, I never would have thought there would be code to not tell you the code is wrong, the only thing I could do 10 minutes ago was look at it and go "Yup, that sure is some code alright." Ok, so a syntax error means a typo. Code is very picky. Ok, it looks like IsNot isn't supported? which means your statements need to change. I edited the codeblocks for you. (basically you have to use NOT (variable Is Nothing), instead of (variable ISNOT nothing))
|
# ¿ Nov 10, 2022 20:12 |
|
Add this to the error block, you need to get your code to signal the errorcode:
|
# ¿ Nov 18, 2022 03:16 |
|
You're issue is this line:code:
Can you post the whole macro? I might have to actually write this myself
|
# ¿ Nov 19, 2022 04:55 |
|
axolotl farmer posted:Is there really no straightforward way to change default ctrl-v paste? I want to paste unformatted text into excel from web pages, just the numbers without color and font. Can't you hold shift? Also there's a section called paste options where you can change the default E: https://www.causal.app/excel-shortcuts/shortcut-to-paste-values-in-excel
|
# ¿ Dec 19, 2022 13:27 |
|
Busy Bee posted:I'm currently grading some of my trading cards and keeping track of it in a spreadsheet. seems simple enough to just use a switch (also, oh gently caress yes excel has built in switch case?) Put this into your new 8th column code:
A with the estimated grade column, C with the 7 column D with the 8 F with 9 G with 10 B with the Ungraded
|
# ¿ Jan 5, 2023 14:11 |
|
Busy Bee posted:That worked! Thank you! The switch function looks for a match and then returns the value when it does, with the last value being no match. So, simply take all the grades in the function, and subtract 1. Then add the 10 pair again (because otherwise it will go to ungraded) code:
code:
|
# ¿ Jan 5, 2023 15:09 |
|
tuyop posted:Any way to add commas or spaces to a large number in a string that is the result of a calculation? Something like this: =CONCAT("1:",TEXT(B1/B2,"#,###")) You need to format the division output, and then concat your 1: onto it.
|
# ¿ Jan 11, 2023 20:37 |
|
You should be able to use the row number or column letter as an indexer on the row/column collection object property that a workbook has to access the specific row/column and then simply assign it to the row/column in the other workbook using the assignment operator. Or a for loop to iterate through the cells of the row column to copy each one individually In this example, everything should be self explanitory. sourceSheet is just the name of the sheet you're copying from. destinationSheet where you're copying to. destinationRow is the place you want your copied row to go. If you want to put it in the same place as the original sheet, change it to sourceRow sourceRow is where you're copying from. as long as the user types a number in the cell you're looking at it can be as simple as: code:
Iterating over that row to copy it will look like this: code:
HootTheOwl fucked around with this message at 14:40 on Jan 18, 2023 |
# ¿ Jan 18, 2023 13:17 |
|
Chat GPT can read the MSDN just as good as anyone. Except me, of course. I'm still worth the big bucks.
|
# ¿ Jan 25, 2023 00:07 |
|
KOTEX GOD OF BLOOD posted:I'm kind of surprised to be struggling with this as it seems like a fairly straightforward thing, but none of the tutorials online seem to have an answer. prefix any range or cell in the second worksheet with the name of the name of the first worksheet plus an exclimation point. So if you want column A from sheet 1 (named source): code:
|
# ¿ Jan 31, 2023 14:42 |
|
|
# ¿ Apr 28, 2024 19:50 |
|
I'm having trouble understanding what you want but a quick and dirty way to get around circular references is nice inputs to a different cell or worksheet all together.
|
# ¿ Feb 19, 2023 03:50 |