"Openoffice Calc" Comparing time using IF always returns false - calc

i am using the following data (Cells are formatted for time (24hr) 13:37) and IF functions but they always return false for some reason
Cell A1 17:00
Cell A2 17:10
Cell B1 17:00
Cell B2 16:30
Cell A4 =IF(A2>A1;"true";"false")
Cell B4 =IF(B2>B1:"true";"false")
both of these return False where as i think the A Cell If Function should return true or am i missing something
Thanks
John

Related

For Excel VBA, If B2 value did not change then A2 will keep same, If B2 is changed then A2 will increase by one

I need a VBA for the whole column B and A says that
if Value of Cell B2 did not change then A2 value will be the same
if B2 value is changed then A2 value will increase by one
Use this formula.
Put your staring number in A1.
Put this in A2:
=IF(B2<>B1,A1+1,A1)
And copy down.

VBA Excel - Transform Column value To another Column along with inserting blank row

I want to tranform the values.
Suppose in A1:A20 there are 20 values and in B1:B20 also 20 values.
I want to copy values of column B in such manner that outcome should be:
Cell A1 value is A1, cell A2 value is B1, cell A3 value is A2, cell A4 value is B1.
Likewise in cell A40 value is B20.
(for more clarity i have attached image)
So here first step is inserting blanck cells alternatively in column A
and than copy value of column B in that blank cells.
For more clarity Please find the image
.
Always post what you have tried first !
Sub test()
Application.ScreenUpdating = False
Dim i As Long
For i = 2 To 20 Step 2
Sheets("Sheet1").Range("A" & i).EntireRow.Insert
Next i
Sheets("Sheet1").Range("B1:B40").copy
Sheets("Sheet1").Range("A2").PasteSpecial Paste:=xlPasteAll, SkipBlanks:=True
Application.ScreenUpdating = True
End Sub
Maybe this is not exactly what you are looking for but an alternative solution is to use a regular formula like below.
=IFERROR(INDEX($A$2:$B$9,ROUNDDOWN(ROW()/2,0),ISODD(ROW())+1),"")
But this won't give the color you are looking for. Just throw out an alternative method for your reference.

Nested 'For' cycle required

I have four cells in an Excel workbook:
A1
A2
A3
A4
A1 and A2 cells include starting values such as 5 and 7. A3 has an formula and evaluates a result using A1 and A2's values. A4 cell has a target value. An iterational operation continue up to A3 cell's value equal to A4's 0,0001 approximation. For each A1's differential increment A2 will change depending on its range.
Can anybody help me with VBA including nested 'For' cycles?
My sample workbook:
There is an add-in with excel that is built to do this, it's called the solver addin.
There's a good tutorial here that explains how it works.

Display formula when cell is clicked vba

So I have something like this:
A B C
1 11 12 13
2 10 20 15
3 1 -8 -2
So A3, B3, and C3 is generated by subtracting A1 to A2 and so on.
If you look at the top of the sheet there is a long bar that shows the formula of a cell when you click on one. If you fill in the sheet manually, you can type in that bar something like = A1 - A2 and it will fill A3 for you.
Right now, because my formula is actually in the code, when I click on A3 for example, the bar only shows 1 instead of = A1 - A2.
How do I get the formula to be displayed in the bar?
Use .formula for your requirement
Worksheets("Sheet1").Range("A3").Formula = "=A1-A2"
My guess is that right now, you're filling your cell along the lines of:
Range("A3").Value = Range("A1").Value - Range("A2").Value
So solve your Problem, use this:
Range("A3").FormulaLocal = "=SUM(A1;A2)"

Call a cell by using a value in another cell

I am trying to call a simple cell (Eg: =a1) in Excel. However this "a1" is available in another cell, let's say in cell 'e1'.
In another way, what I mean is e1 cell has the value "a1" in it and for that reason alone I want to call a1. Finally will in turn populate the value that is actually in a1.
I need to do this is because the cell no. that needs to be populated is retrieved from a formula in e1. That is how the cell a1 comes into the picture.
Using the function: =Indirect([cell]) will give you the value in the [cell]. For example, if cell Z1 has the function =Indirect(E1), and E1 has the value A1, will give you the value of A1 in Z1. Then if E1 changes to, say, A2, then cell Z1 will contain the value from A2.