I have an excel sheet that gets dumped out from a model I use. Unfortunately, I have to take a lot of time by hand to fix these sheets every day. However, it can be really easy to work with if this one change is made.
I attached a picture, the left is what it comes out of the model as, the right is what I would like it to be like in a new sheet. The only problem I foresee is the number of values in the second column is different every time, so the labels in the first column aren't always in the same place.
Any ideas on how to accomplish this would be appreciated. Picture
Fill in the first cell by hand and then just autofill this easy formula:
F3=IF(F3<>"";F3;F2)
Related
Currently, I am trying to calculate daily averages of the availability and performance of machines. In the raw data, each machine has a different number of data points that are needed to make an average from.
Is there a way to get VBA to auto-detect the group of rows, and from then, take the average of the data in those rows?
At the moment, I have it being completed in an inefficient and buggy way held together by duct tape. The ActiveCell moves down until it finds a non-blank cell. It stores the value of the cell into an array and adds more data until it reaches a blank row. Then, it writes the value to the average column, clears the array, and moves down until it reaches a non-blank cell.
I am aware that ActiveCell.select is a terrible way to code, but I don't know of any more elegant ways to accomplish this task.
A sample of how the data will look
If you know there will not be duplicated machines, AverageIfs() is a great option, just make sure to add an And() to check current row and next row as seem below.
If there may be duplicated machines, you can use XMatch() to find the first empty row, and use either indirect() to build your AverageIfs() formula (like i did... but only useful if your data will always be in the same place) or use XMatch() along with Offset() and Sum() if you need the data to move more easily. One drawback is requiring a blank row at the top of the data, but this could be worked around with an additional if statement.
Please note: Yellow cells indicate where the formula was pulled from.
I'm currently working on a spending tracker that looks like this:
Spending Tracker
As you can see, each transaction is sorted consecutively by date and assigned an index number, with each transaction receiving its own row. Each transaction is essentially made of a "Store/Business/Person" text comment, a general text comment, an amount and a category. While this is all helpful information, you can imagine how it would likely get tedious to scroll to each category to enter the correct value.
My question is, what formulas can I use to copy information from a list such as in this sheet... Input List
...into specific places within the main spreadsheet?
It is essentially a more complicated "='Input List'!C2" formula, however if the pasting destination can change based on if statements.
Any help with this would be greatly appreciated!
Assuming that you have both tables on the same sheet, you could try filling the value of each cell previously with the following formula according to the corresponding row in Spending Tracker table:
= IF('Input List'!F2="Option 1",'Input List'!E2)
where "Option 1" would be the selected category in the Input List table.
I am a poker and slots streamer and I use excel alot to export values for my stream overlay.
I have come to a difficult situation where I need one of the bellow behaviors:
Create a button to send a value to a specific cell using something like VLOOKUP
Automatically make a cell update on higher of two values, or else keep it's value.
I'll attach some images for you to better understand:
I have a table on this sheet where I keep all info about the games
Slots Sheet
On this second sheet I have a dropdown on Column B where I pick the game from the first sheet and then fill up C (Best Win) and D (Best Multiplier) columns with Vlookup
SlotStream Sheet
On this second sheet I have some referral cells where I keep the scores for this day on this slot and add the bet size between parenthesis
Today Result + Bet size
So basically, I have a new highscore on this slot "Sweet Bonanza", and I need to keep its "best win" and "best x" updated on the first sheet, using the columns S and T from the second sheet.
One important thing here is that after the stream I will delete the inputs on the second sheet (slotstream), so the values should be sent and kept on the first sheet.
It's my first post here so I am sorry if I did not make myself clear. If you have any question please feel free to ask me.
Thank you in advance.
Ricardo Mateus
I'm working on a personal budget spreadsheet, and I have a tab that calculates what I've spent so far in certain categories and compares that total to what I have budgeted for. I have one column showing how much I've spent and the one next to it shows how much I have left to spend. What I want to do is highlight both the total and the amount left if the column showing the difference is negative. I want to do this for the whole 2 columns. Here is a link to my sheet:
https://docs.google.com/spreadsheets/d/1AXaxVpVpblxwnS7VBhz4yhz1SNXRGCB6Zrb3OIKiaKk/edit?usp=sharing
I think my main challenge is highlighting both cells dependent on only one of them. I've tried some custom formulas but they don't seem to work. I know there has to be a way to do this. Any ideas?
You just need to fix the custom formula with a $ and apply it to G6:H26 so that when it is applied to column G it still checks column H:-
=$H6<0
Hope that helps
I'm tired of merged cells. They just don't work.
So I found a way to avoid merging cells horizontally, when I just need my text to be centered across multiple columns. That's: Range("A1:C1").HorizontalAlignment = xlCenterAcrossSelection.
It works like a charm. It's perfect. It's just what I needed.
I oh-so-naively thought you could do the same vertically, for centering text over multiple rows. Something like: Range("A1:A3").VerticalAlignment = xlCenterAcrossSelection.
But alas, that doesn't work.
Am I missing something here, or did Excel developers really think that, while centering across columns is a common deal, centering over rows is so much of a silly idea nobody would ever do that so why even bother?
You can try this:
Sub VerticalAlign()
ThisWorkbook.Sheets(1).Cells(Round((WorksheetFunction.CountA(Range("A1:A6")) + WorksheetFunction.CountBlank(Range("A1:A6"))) / 2, 0), "A") = "Your Value Here"
End Sub
You'll need to change the ranges being counted, and the column it's referring to, but that should just about do it. A little warning, though: VBA does NOT round the same way that Excel does. It should always be within one digit, though. You can read more about that here: http://support.microsoft.com/kb/194983
We use textbox shapes over cells to do this. If you hold Alt while drawing out the shape, the corners will snap to the Excel grid and move and size with the cells, so it doesn't take much more time than typing into the cells.
I found a happy accident that works around my issue on this if anyone cares to know.
For my situation I needed to track employee vacation time on a linear calendar that was sort-able by name and responsible area. The title section covered three rows that i wanted visible when the data below was filtered. Row 1 = years (merged across months), Row 2 = months (merged across days), Row 3 = days.
Cells A1:A3 was merged and labeled Names (employees), B1:B3 merged and labeled AREA (responsibilities) so we could track vacation time on a calendar spreadsheet to make sure each area had coverage (at least one employee responsible for it was available). The downside of this method caused the filter blocks to be associated with row 1, so row 2 and 3 were hidden when names were filtered on.
Then I tried the VBA code from previous post and it worked, but maxed out at font size that would fit, if too big it would be cut off. So Aesthetically, it looked bad.
Then I put the Names/Area titles in cells A3 and B3 without merge and set filters on row three. This filtered everything starting at row 4 effectively without hiding anything above it, but still looked bad.
Now I found the work around. If you have your titles in the top cell of where you want to merge, and some value in the bottom section. Set filters on the bottom section (need a value to set filters). Then merge the three cells, it works.
So now my A1:A3 Name, and B1:B3 Area is merged, but the filter boxes are on the bottom of the sections (aligned with row 3).
Hopefully that works for some people. I then locked those cells from edit (except auto filter settings) and now it cant be changed accidentally. only filtered.