If statement contingent on data from 2 cells - excel-2010

Using Excel 2010 I need a formula that will respond to data in one cell, and differently to data in another.
Cell A1 = Date
Cell A2 = Invoice Dollar Value
Cell A3 = Discount (formula to remove 15% from A2)
Cell A4 = Refund amount
Cell A5 I want to read... if there is a date in A1, then A2 - A3, BUT if there is a value in A4 then A4 - A2 (note, if there is a value in A4, there will not be a value in A2)
I have tried the following...
=IF(A1<>"",(A2-A3),"",If(A4<>"",A4-A3,""))
So my goal is to have the spreadsheet calculate Invoice amount minus any discount. And in the same cell calculate refund amount minus any discount.

Your outer IF statement isn't quite right. The structure is
IF(Condition,<execute this when true>,<execute this when false>). But you're putting 4 parameters into it.
Try =IF(A1<>"",(A2-A3),If(A4<>"",A4-A3,"")) instead.
NB: This only checks that cells A1 & A4 have values, not that they are of a specific type, i.e. it it isn't checking that A1 has a date.

Related

GoogleSheets Conditional Format based on formula in the current Cell

I have tried the following as the Conditional Formatting Custom Formula:
Where B2 is the current cell:
COUNT(FIND("$B$1",FormulaText(B2)))>=1
the formula in B2 is A2*$B$1 in B3 is A3*$B$1 etc. - but some cells do not reference B1
If I paste this into a cell/range in column C:
=COUNT(FIND("$B$1",FormulaText(B2)))>=1
then it correctly returns true or false depending on the formula in the adjoining cell.
However when applied as a conditional format it is not changing the format of cell B2
I also want this formula to apply to a range of cells - but it seems to apply the identical formula COUNT(FIND("$B$1",FormulaText(B2)))>=1 to each cell and not change B2 to B3, B4, B5 etc.
Thank you you to #kirkg - this is resolved simply by applying the format to a range in both columns A&B:
Here is his sample sheet... docs.google.com/spreadsheets/d/… – kirkg13

Continuous total from only one cell to another as it grows

I am hoping to calculate a total as is grows or decreases using only 1 row and only 2 cells in this row. I'm wondering if it this is even possible with a formula (not a script):
Scenerio:
A1 and A2 have a Value of 0
(A2 is the running total of A1, whenever a number is entered into A1 and Enter is pressed, this number will add to the value of A2)
A1 has 2 entered into it and Enter is press (Cell changed)
A2 adds this to its 0, becoming 2.
A1's 2 is deleted, but A2 remains 2.
A1 has 3 entered into it and Enter is press (Cell changed)
A2 becomes 5
(The only way to add or subtract from A2 is enter - or + number into A1, otherwise A2 remains the current total)
I hope this is clear. I would like all things isolated to a single row, so a normal running total does not work for this case.
To be able to accomplish this task you will need to adjust your Spreadsheet settings.
For your specific case scenario where you just want to add (or subtract) only once the value of A1 to A2 you would need to head over your Spreadsheet menu bar and select File->Spreadsheet Settings-> Calculation. In that tab you should turn on Iterative calculation and set the Recalculation to on Change and the Maximum number of iterations to 1 .
Finally set A2 formula to be = A1 + A2. Every time you change A1 its value will be added (or subtracted if it is a negative value) to A2.
Reference
Choose how often formulas should recalculate

Obtain first date in column after reference date

In cell B1, I have =today() for today's date and then in the cells below (B2:B100), What I'm trying to do is to compare the date in cell B1 (today's date) and to find the next date that appear in cells B2:B100 AFTER this date and then copy this into A2.
So, in effect, in cell A2, I want a function to look up the next date in cells B2:B100 that is the nearest one AFTER B1 and then copy this into A2. I know this is a formula to add in A2 but just unsure what formula to use.
I've tried this in cell A2,
=MIN(IF(B2:B100>B1, B2:B100))
but it didn't work.
"Other things being equal", the formula is correct but should be entered in the array version (eg with Ctrl+Shift+Enter):
=ArrayFormula(MIN(IF(B2:B100>today(),B2:B100)))
Building the function from B1 into the formula is optional.

Conditional formatting based on if/then on multiple fields

I want the background of a cell to be filled in based on one cell and then based on the number of days in the future, which are in other cells.
Cells A3 and A4 have a Date.
Cells B3 and B4 will have text, either "Active" or "Potential"
Cells A10 to A12 are the number of days based on Active.
Cells A15 to A17 are the number of days based on Potential.
Based on the date in cell A3,​​ I want the format of cell A3 to be either red, yellow or green based on certain criteria.
The first criteria is in Cell B3 which will have either "Active" or "Potential".
If B3 says "Active" and the date ​​in A3 is the same as today, then I want cell A3 to be filled red.
If B3 says "Active" and the date in A3 is the same as tomorrow, then I want cell A3 to be filled yellow.
If B3 says "Active" and the date in A3 is after tomorrow, then I want cell A3 to be filled red.
If B3 says "Potential" and the date ​​in A3 is the same as today, then I want cell A3 to be filled red.
If B3 says "Potential" and the date in A3 is in 15 days or less from today, then I want cell A3 to be filled yellow.
If B3 says "Potential" and the date in A3 is greater than15 days from today, then I want cell A3 to be filled red.
I've been struggling to get this right. Any help would be much appreciated!! I pasted an image of my sheet below.
Your screenshot appears to be Google Sheets. As far as I am aware this type of advanced formatting is not available. I recommend using Excel instead.

Compare and Multiply

I want to compare two cells and obtain a percentage, for instance:
A1 is 190
B1 is 200
C1 is the answer
I tried:
B1 >= A1
but the answer is TRUE.
I will create a report if cell B1 s greater than cell A1 then:
IF YES I need to get the 12% percent of cell B1 and the answer would appear on cell C1
IF NOT the value for cell C1 would be 0.00.
Can anyone help me to create a syntax for that?
Try =IF(B1>=A1,B1*0.12,0)
check snap below
And for formatting you can select column, right click - Format Cells - select Number and keep 2 Decimal places.

Resources