Not sure how to word this exactly. We have a spreadsheet to keep track of pump runtimes.
We want to subtract the run times in column B and output to Column C so for instance B4-B5 would output .3 to C4. I don't have a problem with basic formula =B4-B5 in C4 and so on down the column. However when I get to B8 I want B7 to subtract B10 and skip the B8 and B9. The reason is that the 25th and 26th was a weekend so values weren't recorded. (these sheets are printed, recorded on location and then brought back to the plant at the end of the month) so what if possible would be a formula I can use?
after using the formula this is what happens:
enter image description here
Try the following formula in C4 and drag down
=IF(B4<>0,B4-INDEX(B5:$B$33,MATCH(TRUE,B5:$B$33<>0,0)),0)
It's checking the cells below for the first non-zero and returning the difference to that value. The key principle here is in the range B5:$B$33. The dollar signs ensure that when you drag the formula down the end of the range you're checking stays at B33, whereas B5 will become B6, B7, etc.
If the column B entries are stricly non-increasing, as per your example, in C4:
=IF(B4,B4-XLOOKUP(9^9,B5:B$33,B5:B$33,B4,-1),0)
and copied down.
Related
I have the formula below. The overall goal of the formula is to compare dates and tell me how far ahead or behind we are based upon the end date. Column C is for "projected dates" and column D is for "actual dates". So, use the projected until we know the actuals, then switch to the actuals once they're known.
What the formula is supposed to say (basically) is: "If D7 (actual end date) is blank, then subtract the projected dates in C4 from C7, but if D7 is not blank (i.e., filled in with an actual date), then subtract the actual dates in D4 from D7".
The problem is, as soon as you fill in a date in D4 (not D7, as the formula says), the cell where the formula is changes. Which I don't understand, because the formula is saying "If D7 is blank, then do this..." not "when D4 is not blank, do this..."
In other words, it shouldn't do anything until D7 is filled in, but it changes when D4 is filled in.
What am I missing?
=IF(D7="",((($K$14-$K$11)/(100/($C$7-$C$4)))*100)*-1,((($K$14-$K$11)/(100/($D$7-$D$4)))*100)*-1)
I have a table like this:
Name
Response
Thursday
A
Monday, Thursday
Yes
B
Tuesday
No
C
Wednesday
No
This is an output of a Google Form response that I use to collect data, In Column C, every cell contains this formula:
=IF(ISNUMBER(SEARCH("Thursday",B2)),"Yes","")
To populate the "Yes". However, its quite cumbersome to replicate this if I want change "Thursday" to something else. When I try to insert it as C1, as I populate down the cells, it auto increment to C1,C2,C3 etc.
Is there a way to fix the formulate to
=IF(ISNUMBER(SEARCH(C1,B2)),"Yes","")
Across all cells and just have B2 increment?
Thanks!
The cell reference that you are using, such as C1, is relative to the formula position. So when you copy the formula one row down, C1 becomes C2 and so on.
To prevent this you need to make the row and or column address absolute so that C1 remains C1 when the formula is copied somewhere else. To make a row or column absolute, precede the row and or column by the character $. To keep the row absolute, you would use C$1 instead of C1. The key F4 will help cycle through the option when the cell address is selected in the formula.
I want to have a formula that substracts the last cell in a column.
Example:
I fill in a value in the B column every now and then. B2 is the starting value. In C2 I want this formula to show the difference between the starting value and the most recent value. So if I fill in a value in B5 today, the formula should be
=B2-B5
But if I fill in B6 tomorrow, it should automatically change to
=B2-B6
With what formula can I do this?
You can try:
=B2-INDEX(B:B,MATCH(9.99E+307,B:B))
=$B$2-LOOKUP(2,1/ISNUMBER($B:$B),$B:$B)
I have a very basic excel file for looking at the cost of shares and calculating a profit/loss %.
I have the initial purchase price in cell E3 and I have the current share price in F3. I have calculated the percentage profit/loss in G3 by the following formula
=(F3/E3)*100 - 100
What I now want is to be able to apply this formula to the whole G column as I enter a new share price into the F column, it will use E3 as a constant in the formula to calculate daily profit/loss. So the new formula I want is effectively;
=(Fi/E3)*100 - 100
Where Fi = F3, F4, F5, F6 and so on...
I have tried dragging the cell down to extend the formula, which works to an extent but it does not keep E3 constant so I get a divide by zero error.
Any suggestions? Thanks
Start with =(F3/E$3)*100 - 100. The $ is an absolute anchor that tells the formula not to change the 3 in E$3 when filled down.
If there is no value in column F, you can have the result returned as a zero-length string (e.g. "") which will make the cell in column G that holds the formula look blank.
=IF(LEN(F3), (F3/E$3)*100 - 100, "")
Use an absolute reference for E3 in the formula:
$e$3
This will lock the reference if you drag the cell down.
The other way around, if you want to lock the character:
=(F3/$E3)*100 - 100
Friends i need a excel formal, struggling for some thing like this form past few days :(
it should search for the value in which starts with `01` in `B row`
and past that value in `A1,A2,A3,A4.......` till it got another value in `B row`
which stars with `01`.
in my table B1 will start with 01 for 100%
so after B1 if B27 has a value starting with 01, this formal should copy the B1 value from A1 to A26
from A27 it should past the value of B27 (from A27 to some other cell in B row which starts with 01 )
Your English could be better ^^;
Anyway, if I understand well, it seems to me that a simple IF() would suit you.
In A2, put:
=IF(LEFT(B2,2)="01",B2,A1)
In A1, just put the value of B1 yourself since the formula can't reference to cell A0.
Then just drag down the formula.