I have an Excel spreadsheet to which I am adding data on an almost daily basis. It is very simple--the variable just goes into the cells in column B and various formulas spit out results in subsequent columns. Here is the issues, in all of those other columns, I prefer that the columns remain blank until there is a number in the B cell. Right now, the formulas take an empty B cell as a 0 and go ahead a spit out a result. What can I do to keep those blank, even though the formula is there ready for data, until something is imputed?
You can use ISBLANK function + IF condition to achieve this.
=IF(ISBLANK(A3),"",A3+15)
This formula adds 15 to A3 only if A3 is not blank.
In your formula, you can check the value of column B:
=IF (B2 <> ""; B2 * 2; "")
Related
From my research, when a bunch of cells are merged, you can only reference the first row and first column of the merged cells. EG. if A1:A3 are merged, then I can only access the data using A1 only, and A2 and A3 returns 0.
Now let's say I have a column B that has a formula that calculates based on values in column A. If I drag this formula down, then B2 and B3 will end up using value of 0, when they should be using value in A1.
Effectively, what i want to do is "if the cell in column A (of this row) is blank, then use the last non-blank value going upwards".
I know this will need to combine a couple of formulas, but I can't figure out how to create this. For a start, I can use the Offset function to "go up", but the difficult part here is how to find the previous non-blank cell?
I also tried combing OFFSET with COUNTA (see https://www.exceltip.com/other-qa-formulas/get-the-value-of-the-last-non-blank-cell-in-a-column-in-microsoft-excel.html), but this doesn't work if this occurs multiple times.
Easiest way is to use a helper column:
In B2 write
=IF(NOT(ISBLANK(A2)),0,B1+1)
and in C2 write
=OFFSET(A2,-B2,0)
Edit: actually... the solution without helper column is even easier! Write in B2:
=IF(ISBLANK(A2),B1,A2)
To avoid the helper column, you can use the INDEX + AGGREGATE functions:
=INDEX($A$1:A1,AGGREGATE(14,6,($A$1:A1<>"")*ROW($A$1:A1),1))
Imagine a sheet like this:
A1 = 1
B1 = 1
C1 = A1+B1
It has about 20 rows, to make the it work on next rows I have to copy the C1 content and paste it on column C.
But I noticed that I don't need to do that, and every time I put data on A and B column, the column next to B, which is C, automatically sums them up.
For example: In Row 21, C21 is empty, but If I put data in A21 and B21, the C1 automatically sums them up without having any formula in it.
How's that possible?
If you have a repeating pattern, Excel tries to carry it on for you.
So, if you have headers in A1/B1/C2, numbers in A2:B20, and a formula in C2:C20 to add the values in columns A and B, then type a value in A21, hit [Tab], type a value in B21 and then hit Tab or Enter, the Column C formula will automatically be copied into cell C21.
Testing exactly that (Add headers, start in A2: value, Tab, Value, Tab, =RC[-2]+RC[-1], Enter, loop), Excel started autofilling in cell C6 (i.e. the 5th row of data)
its possible that you have the autoadd function activated on that cellAuto-sum Excel, which do that add without put any formula.
I'm trying to create a formula in column K which sums all cells that apply , in column J, only when the following conditions are true:
dates are the same in column A
AND client name is the same in column B
For example, in cell K2, I want the sum of J2+J3+J4 because A2=A3=A4 and B2=B3=B4.
K5=J5 only, because there are no other dates with the same client name.
K6=J6+J7 because A6=A7 and B6=B7.
What kind of formula would I use for this? I can't figure out how to do it with a SUMIFS.
I would try using a pivot table with:
The names as row values
The dates as the column values
And funds received using SUM in the values column
Edit
Based on #pnuts comments here is how to get the values in column K. Put this in K2 and drag down.
=IF(OR(COUNTIFS($B$1:B3, B3) = 1, B3 = ""), SUMIFS($J$2:J2, $A$2:A2, A2, $B$2:B2, B2), "")
This formula will give blank values until the formula finds a new client on a new date. However, I still think using pivot table is a better solution.
However, I still find the pivot table
In cell K2 put following formula:
=IF(COUNTIFS($A$2:A2,A2,$B$2:B2,B2)=1,SUMIFS($J$2:$J$10,$A$2:$A$10,A2,$B$2:$B$10,B2),"")
Adjust row 10 value. It will be last row of your actual data.
Copy down as much you need.
EDIT
Uploaded file shows the cause behind formula not working correctly for you. It turned out to be whitespace characters in column B (names) data e.g.
Cell B3: "Moe John" has a trailing space.
Cell B10: Same case with "Doe Jane"
If you want to use above posted formula then all names shall be corrected. Or alternatively to deal with spaces you can adopt below approach.
=IF(COUNTIFS($A$2:A2,A2,$B$2:B2,"*"&TRIM(B2)&"*")=1,SUMIFS($J$2:$J$28,$A$2:$A$28,A2,$B$2:$B$28,B2),"")
Notice the change in COUNTIFS formula where B2 is now replaced with "*"&TRIM(B2)&"*".
Even such formula will take a beating if you have uneven whitespace characters in between your data. I'd suggest normalizing it as much as possible.
I wonder if you can help, I am working on a spread sheet where Column B is populated with data.
What I want to be able to do is to say (using b3 as an example)
If B3 is populated then A2+1. I am using this formula in cell a3:
=IF(B2 > 0, A2 +1)
which gives me the result I want but when I hit a blank cell in B it starts the count over again. so I tried:
=IF(B2 > 0,A2 +1,A1 + 1)
but that counts my blank spaces. I need it to continue the count from the cell above without counting blank spaces. I have also tried applying the formula through pentaho to no avail.
It would be good if the formula actively looked and populated Column A instead of a manual formula having to be copied.
I have also used the COUNTIF function but I don't seem to be able to get it to work.
I hope this makes sense.
With column B like:
Place a starting value in A2 and in A3 enter:
=IF(B2>0,MAX($A$1:A2)+1,"")
and copy down:
So I have a cell (let's say C3) and I have a column in A.
Let's say that the formula I want to fill for the cells in columnA is A2 = A1 + 1 and so forth.
I have the number 30 in C3.
I want excel to fill exactly 30 cells down column A using that previous formula (A2 = A1 + 1).
If I change the number in C3 to 50, then excel will automatically add 20 more rows in column A following the same pattern.
If I change the number in C3 to 10, excel will automatically delete the rows until the first 10 rows remain.
EDIT TO ADD: OK so I guess I have to use macros. Anyone suggest the VBA code for this?
You can avoid VBA if you know a maximum possible number of rows. Use the following formula in A2 and apply it downward until you've applied through the maximum number of columns.
=IF(ROW()<=$C$3,A1+1,"")
So in reality, you still have a formula in these cells, but you won't see any output until they are supposed to be seen. It's a work-around.