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:
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))
I have an Excel sheet in which I want start column D with the following formula:
=AVERAGE(C7:C10)
I want to be able to drag down column D to give the following formulae:
=AVERAGE(C11:C14)
=AVERAGE(C15:C18)
=AVERAGE(C19:C22)
etc.
However, if I just naively drag down, instead, I get:
=AVERAGE(C8:C11)
=AVERAGE(C9:C12)
=AVERAGE(C10:C13)
How can I change this behavior?
In column D enter
=AVERAGE(OFFSET($C$1,4*ROW(C1)+2,0,4))
Then when you drag it down column D, each successive cell will have the reference incremented by 4.
This answer assumes that the size of the ranges remain constant. If, for example, column G is unpopulated then G1=7;G2=11. Select both cells and pull the fill handle down as far as needed. The formula for D1 is=AVERAGE(INDIRECT("C"&G1&":C"&G1+3)), which can be filled down as far as needed.
I need some big help on this.
I need to increment my cell references in a formula everytime some condition is used.
Let's say i take my data to be displayed in A3 from B3, my formula will be A3 = B3 in simple terms, but the next day I will need A3 to take data from B4 instead as B3 will be my past data already, how will I increment the formula to change to A3 = B4? Forgive me on my ignorance.
Based on your clarification in the comments above, this should work fine:
=OFFSET(B1,COUNTA(B:B)-1,0)
Input the above in A1. It will always return the last row in Column B (assuming your data in Column B is contiguous).
Screenshot:
Set-up:
Result:
Hope this helps.
As an alternative to the Offset() suggestion, try in A1
=INDEX(B:B,MAX(IFERROR(MATCH(99^99,B:B,1),0),IFERROR(MATCH("zzzzzzz",B:B,1),0)))
This will work with both numeric and text data. You can edit the formula to remove the Match for numbers if your file only has text in that column, and vice versa.
Key differences to the Offset() suggestion:
this formula will return the last entry in column B, even if there are gaps and blank cells in column B
the index/match combo formula is not volatile. Offset() is volatile and will cause the whole workbook to recalculate when any cell anywhere in the file changes. In large data models with many calculations, that can cause slowness. I a small spreadsheet, you won't notice a difference.
I have 2 sheets in my spreadsheet. Sheet2 pulls information from Sheet1. In sheet2, there are 2 columns. Column A has company names. Column B has a formula which searches for the company name of that row within sheet1, and sums the values from that row in sheet1.
I have been able to achieve this with the following formula.
=SUMPRODUCT((Sheet1!B:B=A1)*(Sheet1!F:F))
This works fine, however I have to manually type "A1" into the formula. For the other rows, I would have to write B1, C1, D1 etc.
I have searched for how to reference the cell to the left, and I found this formula...
=OFFSET(INDIRECT(ADDRESS(ROW(), COLUMN())), 0, -1)
This seems to work as a standalone formula in a cell, but I cannot figure out how to incorporate this into the SUMPRODUCT formula. Anything I try gives errors. I need something like this.
=SUMPRODUCT((Sheet1!B:B=(=OFFSET(INDIRECT(ADDRESS(ROW(), COLUMN())), 0, -1)))*(Sheet1!F:F))
As per pnuts' suggestion to make it an answer:
The answer is just to drag the formula around. Just make sure to fix (either use F4 or add dollar signs) your range if it is not an entire column or an entire row
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; "")