Excel merged cell contains multiple values problem - excel

I have encountered an excel spreadsheet, where some merged cells are. The problem is that when i sum over the cells, the value is higher then i can visually see in the cells.
For example: let's say i have merged cells A1:B1 into one and wrote a formula in that cell that gives the result 5 which i can visually see in the cell, but when i sum over the cell, the value is 6. Also upon unmerging the cell i can see formula in cell A1 and number 1 in cell B1.
Obviously, i can sum only over the A column but why is this happening? Has anyone encountered such a thing? I couldn't find anything about this.

Related

Search for duplicate cells within n + and - range of that cell

Hello everyone and thank you for your time.
I have a large table (A:2 to F:270) that we use to communicate the production schedule for the week. I would like to highlight duplicate lot numbers in column A and then highlight the whole row. Problem is, I only want it to compare within a certain range of each cell in column A (I don't want to compare it to the whole table).
For example, I would like the lot number in cell A11 looking for duplicates between A1:A21, and the lot number in cell A12 to look for duplicates between A2:A22 and cell A13 to look for duplicates between A3:A23. I can use conditional formatting of VBA whichever is easier
I have tried conditional formatting but it looks for duplicates throughout the entire table and highlights ALL duplicate lots numbers
You could create an extra column that returns TRUE when the lot number in that row is a duplicate of the range around it using:
=COUNTIF(A1:A21,A11)>1 for cell B11 in my example. It looks at the value in A11 and if it appears more than once in the neighbouring range, it returns TRUE. As you drag this formula down, the range will change e.g. cell B13 will be =COUNTIF(A3:A23,A13)>1.
You can then set up a conditional formatting rule to highlight the row when it equals TRUE.

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 define excel SUMIFS criteria considering any text and numbers?

My SUMIFS formula criteria is based on a cell (say A1) that is data validated by list and changed via selection by user. If cell has data inside text or number by selection from drop down list, SUMIFS formula is considering that data as criteria to calculate the related sum. If criteria cell is left blank, I want formula to sum everything without any condition. My problem here; in criteria field of SUMIFS formula, I typed if condition like; SUMIFS(sum-range,criteria_range,IF(A1<>"",A1,"*")) but in this case excel considers only text values and do not include cells containing number. Briefly, if nothing selected in A1, I want SUMIFS formula to sum everything without any condition, numbers, texts and even blank cells. How can we proceed to do that?
EDIT:
Here an example for data and formula, what is expected is actually to disable criteria if one of selection is blank on left. Harun's suggestion works but if there is blank cell in criteria range, then in this case it won't consider those values in sum. For instance, if we select from left Phone/smart/touch, then how can we get "2" as output no matter what is in cri_range4 cells? Thanks
Example:
How about this solution? It basically ignores a missing entry in column C and evaluates only the other two. (Your example formula has a fourth criterium that isn't apparent in your list but the method can be extended for as many criteria as you might have.
=SUMPRODUCT((IF(LEN(C2),(INDEX(Lists,,1)=C2),TRUE))*(IF(LEN(C3),(INDEX(Lists,,2)=C3),TRUE))*(IF(LEN(C4),(INDEX(Lists,,3)=C4),TRUE))*SumRange)
For better readability I created a named range Lists which comprises your sample range E2:H10 while I named I2:I10 as SumRange'. INDEX(Lists,,1}` refers to the first column of the range. It's important that SumRange and Lists have the same number of rows.
If A1 is blank then just use not equal operator to sum all cells that are not blank. Try below.
=SUMIFS(D1:D5,C1:C5,IF(A1<>"",A1,"<>"))
Edit: can you check below formula in D3 cell then drag down.
=IF(C2="",SUM($I$2:$I$10),SUMPRODUCT(($E$2:$H$10=C2)*($I$2:$I$10)))

LibreOffice highlight cells if they are the same as a specific range

Master and Step Chart
Hello, I'm using A4-E4 as a "Master" code, and incrementally using A5-A8 to replace A4, B5-B8 to replace B4, etc etc first replacing one number of the "master", then two different numbers, etc until I have basically every combination. At some point the same number as the "master" is going to be generated. I have the numbers separated into groups of 16 on individually sheets for a total of 64 sheets. Obviously at some point the same number "43254" is going to generate on one of the sheets. Is there a way to search/highlight that number automatically upon generation? I've found that I can do conditional formatting to search for a specific cell, but not a range of cells. Like compare "A4-E4" to every set of five adjacent numbers in all the sheets, then highlight it. I have no idea if this is possible, but I'd appreciate it.
Select cells A4 through E4 and go to Format -> Conditional Formatting -> Manage. Apply style Good if Formula is:
CONCATENATE($A4;$B4;$C4;$D4;$E4)="43254"
So 43254 matches.
And 43253 does not match.
This is more complex than first appears. The following explanation may be difficult to understand if you do not have much experience with conditional formatting.
The formula gets evaluated 5 times, once for each of the cells.
Normally, rather than always indicating cell A4, Calc would interpret A4 as the currently evaluated cell (because we selected cells starting from A4). And B4 would indicate the cell to the right of the current cell that is evaulated. So for example, if such a conditional formatting formula were filled to cell D7, then A4 would actually indicate cell D7, and B4 would indicate cell E7.
However, our formula uses $A4 instead. The $ tells Calc that we always want column A even if the formatting is for column B or C et cetera.
One outcome of this is that the formula can be filled down or up but not left or right. If it is filled down one row for example, $A4 refers to column A but the current row, which would be cell A5.

Highlighting rows based upon two adjacent cells being different but specific numbers

I am trying to put together a conditional formula for an Excel spreadsheet. What I need is for the row to highlight when cells A2 and B2 are two different, but specific numbers. For example, I want the second row highlighted when the value in A2 is exactly 12345 and when the adjacent value in B2 is exactly 67890. I do not want the row highlighted if the value in A2 is anything other than 12345 and the value in B2 is anything other than 67890. There are about 3,500 rows of numbers, so I am trying to speed up the process. I will eventually have to do the opposite, and see when the value in A2 is 67890 and when the value in B2 is 12345.
In order to clear up any questions, I am looking at an Excel document tracking phone calls made over a long period of time, and I want to highlight the whole row when two different phone numbers are calling each other among all the other phone calls.
With conditional formatting, you can use formulas. Highlight a row (let's say row 2 to start), and in Conditional Formatting, under "Use a formula...", =and($b2<>$a2,$a2=12345,$b2=67890).
If you apply that to your whole range (a2:b100, let's say), if the cell in A and B are different, and then only if A and B are the numbers you want, will the row be highlighted.
edit: added absolute cell references. Also, see #Grade'Eh'Bacon's comment.

Resources