If 1 or 2 cells are blank then - excel

I'm trying to write a simple formula to check whether either 1 or both cells are blank and, if so, leave the resulting cell blank. I want the resulting cell to only display a calculation if both cells are filled in.
I've got this do far though it doesn't work as I wanted: =IF(OR(C4<>"",B4<>""),A4-C4,"")
b4 has a date and c4 has a numeric value (4). the formulate is in d4. I want to check if b4 or c4 are blank and, if so, leave d4 blank too, else take c4 from a4 (14 as of now).

It should work:
=IF(ISBLANK(C4);"";IF(ISBLANK(D4);"";A4-C4))
It checks if C4 is a blank cell, if not then checks if D4 is blank, if not then does the math.

I recommend using ISBLANK to check for blank cells.
Formula for your D4:
=IF(OR(ISBLANK(B4), ISBLANK(C4)),,A4-C4)

Just try this formula
=IF(AND(C4<>"",B4<>""),A4-C4,"")

Also, I used =IF(A2&B2="",TRUE VALUE, FALSE VALUE) which worked great

Related

date formula to return blank if cell is empty

I have the following formula in cell R3. =If(Isblank(E3),"",(E3)+365. This formula gives me the date I am looking for if I have a date entered in cell E3. However cell E3 does not always have a date in it. When there is no date in cell E3 I get #Value in cell R3. Is there a way to leave R3 blank if no date entered in E3.
How about:
=IF(E3="","",E3+365)
Alternately you could wrap your entire formula within an IFERROR() function:
=IFERROR(IF(ISBLANK(E3), "", E3+365), "")
The advantage of this (or disadvantage depending on which way you look at it) is that it will also mitigate any other errors you might encounter from incorrect data types being placed into cell E3, such as #DIV/0, etc.

Excel SUMPRODUCT and MMULT with condition

Hello I need to make a sumproduct with general conditions.
The correct values is shown in cell B6, B7 and B8
In cell B6 I have this formula =A1*A2+B1*B2+C1*C2 to understand what is the result that I expected.
In B7 is =D1*D2+E1*E2 and so on...
I've tried with this formula =SUMPRODUCT(A3:G3=A6,A1:G1,A2:G2) in cell B6 but the result is 0.
Use =SUMPRODUCT(1*(A3:G3=A6),A1:G1,A2:G2) in cell B6.
Better still use =SUMPRODUCT(1*(A$3:G$3=A6),A$1:G$1,A$2:G$2)
and you will be able to copy the formula from B6 to B7:B8 and it will behave as you want.
From this page, I learned that "--" can transform True and False values into 1's and 0's.
That's probably why you are getting 0, the formula you use adds boolean values to numerical values.
So the formula you are looking for in cell B6 is =SUMPRODUCT(--(A3:G3=A6),A1:G1,A2:G2).
Tested on Excel 2010, it worked.

Subtract values of ranged cells from a cell if ranged cells are not blank

First, my apologies for the confusion of this question. The title probably isn't worded very well, but I couldn't think of a better way to ask it. And because I don't know how to ask it simply, I could not find any answers.
I am wondering if there is a way to subtract a value of a cell from another cell if yet another cell is not blank. This is simply done when not using a range using something like:
=if(a1<>"", c1-b1, c1)
But I want to check multiple cells in a range. If a cell in that range is not blank, subtract a correlated value from a working total, otherwise subtract nothing. Go to next cell in the range, if that cell is not blank, subtract a correlated value, and so on...
Let's say:
Original value to be subtracted from is c1
Range of cells to be checked are a1:a10
Coorelated value to subtract is located in b1:b10
So... in a1:a10, there will be date. If a1 is not blank, subtract b1 from c1. Lets call this value workingValue. Go to a2... if a2 is not blank, subtract b2 from workingValue. Go to a3... if a3 is not blank, subtract b3 from workingvalue, and on down the list.
The final workingValue can go anywhere, but for simplicity, let's put it in C2.
Is this possible with an excel formula (not VB)?
Use this in C2:
=(C1*ROWS(A1:A10))-SUMIF(A1:A10,"<>",B1:B10)

Conditional Formatting (If cell above and below is number, format only cell below)

I'am trying to create a conditional formatting which formats only cell below, but only if cell above and cell below both has number in them (negative or positive).
Now i got this:
=ISNUMBER(OFFSET(INDIRECT(ADDRESS(ROW(); COLUMN()));-1;0))
This formats the cell below if the cell above has a anything. It does not respect the condition where the cell below also must have a number.
Could somebody help me out here? I am realy stuck :)
EDIT:
So now i tried this:
=AND(ISNUMBER(INDIRECT(ADDRESS(ROW();COLUMN()))); ISNUMBER(OFFSET(INDIRECT(ADDRESS(ROW();COLUMN()));-1;0)))
But no luck whith this one either.
Just to clarify. This formula should run on $A$3:$BB$100
So for example if:
A5 = 10 (or any positive or negative number)
A6 = 10 (or any positive or negative number)
A6 should be formatet.
But if:
A5 = 10 (or any positive or negative number)
A6 = EMPTY
No formating should happen.
Hope this clarify what i'am trying to do :)
=AND(ISNUMBER(A5),ISNUMBER(A6)) This formula will also bypass formatting for A6 as well if both cells are empty. I assume that's what you want, as there's no value within either to format.
I see why we are getting different results with the formula. Conditional formatting is applied relative to the active cell when applied. Start with cell A2 as the first cell highlighted, (A2:A100),and then use this formula =AND(ISNUMBER(A2),ISNUMBER(A1)).Cell A2 should be the first active cell within the range of applied formatted cells.

Excel: If either D2 or F2 is 0, leave G2 blank

Both D2 and F2 contain formulas that rely on inputted values in other cells. In a third cell (G2), I have a formula that utilizes both D2 and F2. I get accurate results just fine. However, using the formula below, when either D2 or F2 has no value the third cell says "#VALUE!" when I would prefer it to stay blank.
How do I fix that? Neither D2 or F2 are blank because they contain formulas, so I cannot use the ISBLANK condition. And my formula is not fixing it:
=IF(OR(D2=0,F2=0),"",IF(F2>D2,F2*2,F2))
Can anyone help me out?
They don't really return no value - if they contain formulas then they return something. Whatever that something is apparently not interpreted as equal to zero, as blanks are.
You could use:
=IF(AND(ISNUMBER(D2),ISNUMBER(F2)),IF(F2>D2,F2*2,F2),"")
Or simply:
=IFERROR(IF(F2>D2,F2*2,F2),"")
Note that this last will return the value of F2 if F2 is a number but whatever is in D2 is text, since Excel can compare text and numbers, and considers text to be greater. But, you say that you get an error when either has "no value", in which case this will work as expected.
Try:
=IF(D2=0,"",IF(E2=0,"",IF(F2>D2,F2*2,F2)))

Resources