Auto +6 increment while dragging cells in excel - excel

So, I got an excel with two sheets: Sheet1 and Sheet2, in which I transfer data from the first to the second using the formula: =IF(INT(+INDIRECT("Sheet1!A1"))< 42900,0,+INDIRECT("Sheet2!A1")) (the cells are custom format dd/mm/yyyy hh/mm/ss). In Sheet1, the cells are organized in groups made out of 6 columns (in this example, A being the first column within the group).
In Sheet2, when I drag the cell containing said formula to the cell on the right, the formula remains the same. I want so that when I drag the cell, A1 will become G1, basically incrementing the column "number" by 6 jumping to the next group of 6 columns.
Is there a way of doing this WITHOUT using any coding. I need to avoid coding at all costs in order to avoid further complications.
P.S. I apologize if my explanation and title are somewhat vague.

Enter below formula anywhere in Column 1 and drag/copy across (to right)
=IF(INT(INDIRECT("Sheet1!" & ADDRESS(1,FLOOR((COLUMN()-1)*6,1)+1)))< 42900,0,INDIRECT("Sheet1!" & ADDRESS(1,FLOOR((COLUMN()-1)*6,1)+1)))
This formula will refer to cells $A$1,$G$1,$M$1,$S$1,.....
If you have to use this formula in say Column B then change (COLUMN()-1) to (COLUMN()-2) and likewise for Column C,D,E,.... use (COLUMN()-3),(COLUMN()-4),(COLUMN()-5),.... respectively.

Related

Excel table auto-fills incorrect formula when inserting rows

I have an Excel 2019 Workbook in which I have a sheet with a range of cells defined as a table. Table columns are A to H, where columns A and C contains formulas and the others have to be manually compiled with information by users. The sheet is protected, with the cells in columns without formulas unlocked, so that users cannot alter formulas, but they are allowed to add rows (in the middle of the table, not at its end) as this can be required.
The problem is that when adding rows, the formula auto-filled in column A for the row below the new one is incorrect.
Detailed explanation
Column A is used to assign an unique number to what si written in column B, so that if an element in column B is repeated, the corresponding number in column A is repeated as well
The first cell of the table in column A (A4) contains the value "1"
Cell A5 contains the formula "=IF(B5=B4;A4;A4+1)"
Cell A6 contains the formula "=IF(B6=B5;A5;A5+1)", and so on
If I add a row between 5 and 6, the formula in the new cell A6 is correct, but the formula in cell A7 becomes "=IF(B7=B5;A5;A5+1)", instead of the correct "=IF(B7=B6;A6;A6+1)"
Formulas in all the cells below A7 are correct
If I manually fill the formula in A7 form another cell by using the fill handle, the formula corrects itself
I know there is a similar thread MS Excel Auto-Fills Incorrect Formula When Adding Rows and I already tried some workarounds described there such as clear the column and then add the formula back again, but without results.
My situation seems to be different because the formula is not present in the entire column because of the "1" in A4.
Even though the problem can be manually addressed with little effort via the fill handle, this is not a suitable solution since users may not correct the formula, which is needed for some other calculations in another sheet of the Workbook.
The behaviour you describe is normal and nothing to do with tables. If you insert a row in between a cell and another cell it references directly in a formula, that formula will not adjust to refer to the new cell. In other words if A6 contains =A5 and you insert a row between rows 5 and 6, that =A5 will not suddenly alter to be =A6.
If you need that behaviour, you would need to use something like INDEX or INDIRECT - for example:
=INDEX(A:A,ROW()-1)
will always refer to the cell in the row above the formula cell.

How to Apply Conditional Format to show a field is mandatory to be filled in based on a vlookup to another sheet

I'm trying to create a form in excel for my team to fill out which highlights certain cells in a row as compulsory (format the cell colour) based on the number from a table in another sheet which has 3 preset dimensions ("M"=Mandatory, "P"=Prohibited, "O"=Optional) for each number across multiple analysis field.
I have tried conditional formatting formulas to highlight the cell to fill out if the lookup of the number chosen returns "M") but I don't seem to have a formula which validated this and returns with the cell highlighted when it needs to completed.
I would like the formula to return the cell as highlighted if it is mandatory based on the lookup to the table and need the user to fill out the cell with the information relevant.
Any help would be much appreciated.
If I understand your question correctly you just want the cell to highlight when its sister cell in another sheet is coded "M". That's a fairly easy formula.
=Sheet2!$B1="M"
This is for a straight column in B, where the cell it's checking against is in sheet 2 and also in column B. If it's for a row simply move the $ to say b$1.
If you want the highlight to disappear when the cell is filled in use this formula:
=AND($B1=0,Sheet2!$B1="M")

Formula to Search for Data in One Column, then Apply Formula

I am working on a personal budget sheet in excel, and it's formatted based on my pay dates, to provide more drilled-down information. I have attached an example of it below for reference.
I would like to put a formula into J2, J3, and J4 which will take the data in cells C9:C26 and H9:H16, match it to the date in cells D2:D4, then subtract the expenses in D9:D26 and I9:I16 from E2, E3, and E4.
As you can see, I have just individually summed the cells; however, I would like a formula to be able to adjust as I change the value in cells C9:C26 and H9:H16.
I have found that I can do it with ONE cell, but not multiple or a range. This is the formula I used, and I cannot find a way to make it apply to the entire range of cells: =IF(C14=D3,E3-D14)
I've also tried: =IF(C9:C25=D3,E3-D9:D25) -- I know this formula doesn't work and why. I cannot figure out how to get column C to correspond with column D.
The Budget Sheet
You just need to use SumIf().
In cell J2, put this formula: =SumIf($C$9:$C$25,$I2,$D$9:$D$25)+SumIf($H$9:$H$25,$I2,$I$9:$I$25) and drag down the three cells.
With that, you can add E2-[formula] to subtract all that from E2. Or of course, just do e2-J2 instead. I think that should do what you're looking for. If it's not quite it, let me know and I can tweak.
If you plan to have more than 1 criteria go with SUMIFS
Yes, with S

Row Number In Formula Not Counting When I Drag

I have the formula below that I'm using to link to a certain sheet and cell in my workbook that contains a graph for each entry. On the sheet I link too, each graph is about 20 cells down from the previous one. I have over a 100 graphs now and it will grow in time so I was trying to use the HYPERLINK formula rather than the Hyperlink button for this. I thought I would be able to just insert the formula in the first row, paste it in the second row with an added 20 cells, highlight the two and drag it down but it will not count in increments of 20.
Is this even possible?
=HYPERLINK("#'Trends'!A25","Click To View Trend")
I'm thinking you will have to use some type of concatenation to get the behavior you are after. To do this, you may want to employ a "helper" column. For example, put the "numbers" you are after in column B -- below you will see that I incremented it by 5.
Now your HYPERLINK formula in cell A1 is written as:
=HYPERLINK("[Book1]Sheet2!A"& B1,"Click Me for Sheet2, Cell A"&B1)
(Assuming the workbook is called Book1. Now, I can drag that formula down and it will update "dynamically" to account for the changes in column B.

Excel Formula Referencing

quick excel question:
If I put values in cell B1 and B2.
Then write the following formula in cell A1:
=$B$1-$B$2
then I highlight cells B1 and B2 and move them to column C. the formula in A1 automatically adjusts for the move ie. formula now becomes:
=$C$1-$C$2
How would I get it to stick to column B and not switch to column C. I tried searching google but did not get right answers (probably am not phrasing question correctly).
The context of my problem is that formulas in one sheet are being calculated based on month end data which is placed in another sheet. Now I need to add April month end data. So I shift the old data to the right and input April's data, but the formulas are automatically adjusting for the shift and still refer to March's month-end data. This despite the formulas using absolute referencing.
Thanks for any help provided
The formula you are looking for is
=INDIRECT("B1")-INDIRECT("B2")
This will always refer to Cells B1 and B2 regardless of what you to do move the cells or add new columns etc.
This will allow you to simply insert a column for the new month.
Not a good spreadsheet design, you should really add new data to a new column.
However, if you are determined to stick to that design, copy and paste the old values to a new column, then delete the originals. Formulas will not be alterd by that.

Resources