IF Function leaving Date-Formatted Cell Blank - excel

I have a cell Formatted as a date (M/dd/yyyy HH:mm). The function in this cell is:
=IF($CX$30,MAIN_LEL_BUMP,"")
This is saying that if a check box is clicked (CX30), find the value of MAIN_LEL_BUMP, otherwise leave the cell blank. The issue is sometimes the users do not enter the value of MAIN_LEL_BUMP and consequently the cell gets autofilled with 1/0/1900 0:00. This will pass my date validation checker that I have, but needs to be the accurate date. if MAIN_LEL_BUMP is not filled out, then it absolutely needs to leave the cell blank so that the data validation will pick it up as not being entered. I have looked around on the web for this, and changing the "" to the actual cell name did not work either. HELP

Seems like all you need is one extra condition to check the value of that cell. The following formula will only use the value of MAIN_LEL_BUMP if your original criteria AND MAIN_LEL_BUMP is not empty. If either condition fails you will get your empty cell.
=If(AND($CX$30,MAIN_LEL_BUMP<>""),MAIN_LEL_BUMP,"")

Related

Display the value from the formula ONLY if another cell has the value that I want

I've devised a formula that I want my cells to have, but I only want the value to show up if ANOTHER cell is populated with the value that I want.
My current formula is below:
=COUNTIFS($R$3:R21, "Brain")
However, this formula doesn't check whether or not the other cell has the value that I want to check for.
I put together a formula that I thought would check for whether or not the cell is populated:
=COUNTIFS($R$3:R21, "Brain", R21, "Brain")
Unfortunately, this formula doesn't work (it returns #VALUE!). I think it fails because R21 is already included in the COUNTIFS.
I also tried this similar formula, which also failed to work:
=COUNTIFS($R$3:R21, "Brain", R21:R21, "Brain")
I looked online and I found this possible solution:
=IF(ISNUMBER(SEARCH("Brain",R21)),"COUNTIFS($R$3:R21, 'Brain')","")
Unfortunately, this formula displays the text of the formula I want, and not the actual value of the formula.
Does anyone know how I could display the value from the formula ONLY if the cell I'm checking has the value that I want? Thanks.
Try
=IF(ISNUMBER(SEARCH("Brain",R21)),COUNTIFS($R$3:R21, 'Brain'),"")

How can I use a formula with an IF function?

I'm wanting to check for blank cells, and when the cell is not blank, output a formula. However, I am getting errors and I believe you're not allowed to use formulas within an IF function, are you guys able to help me out?
=IF(A1="","",=lastModified(A1))
If the cell is not empty, this formula will return the date the cell was last modified. I do not want the date updated if the cell is blank.
Thanks for the help.
If you want to call the formula, just remove the equals sign. It will call when the FALSE condition triggers in your IF statement.
=IF(A1="","",lastModified(A1))

Excel Custom Data Validation Allows Invalid Values

I am trying to write a custom validation formula to require the following conditions for Cell O22 on a spreadsheet:
Value must be a number
Value cannot be zero
Value must be greater than or equal to 0.001
Value must be greater than the cell to the right
In the example, O22 is the gross weight for an object and P22 is the net weight, so both will be numbers.
So I plug in the following formula to a custom data validation box:
=AND(ISNUMBER(O22), O22<>0, O22>0.001, O22>P22)
However, when I go to enter in an invalid value such as the letter "A", no error message appears. I can put the exact same formula into another cell and it will evaluate as false, because "A" is not a number.
After building the formula out one condition at a time, everything works correctly until I add the O22>P22 test. This is when it starts accepting any value without error. Can anyone suggest a workaround for this?
You need to uncheck the Ignore Blank check box in the Data Validation dialog box. If Ignore Blank is checked, no data will be validated as long as a cell in your validation formula (in this case P22) is blank.
Once Ignore Blank is unchecked, any formula that returns FALSE will be considered Invalid Data.

Formula in excel not considering dynamically generated values in cells

I'm having a formula in some cells which is based on values in other cells(say A1,B1) which in turn are getting populated from database.My formula is coming correct but it is always considering null value in A1,B1...ie,on opening my excel, the value in cells having formula is always zero..unless I change it in the generated excel.
I want it to consider cell values which are getting dynamically populated and then show the result.Please help!!!!!
In case your sheet has some formula for say A3=sum(A1:A2) is calculated and it is working fine with A1=5, A2 =4. Now if change the value of A2 with 2 like
sh.getRow(0).getCell(0).setCellValue(2); // set A1=2
and perform write operation, check the value of A3 it is still showing 9. It seems wrong but actully not. The point is that Excel caches previously calculated results and you need to trigger recalculation to updated them.
wb.getCreationHelper().createFormulaEvaluator().evaluateAll();
or with
wb.setForceFormulaRecalculation(true);
and then perform Write operation. This will give you the correct result. For Detail check here

Force the user to input value in cell based on another cells value

I'm currently working on the following excel workbook that is to be used for recording test cases:
If the user enters fel in the F column, it will color it red. Fel means fault" (in swedish) so I want to force the tester to register this error in the bug tracking system whenever one of the test-cases fails. The column I should contain which ID to this error in the bug tracking system. So what I'm trying to achieve is:
If the tester have entered fel in the column F, it should force or make the tester aware of that no ID have been entered in the I column. One idea is to color the corresponding I cell red if the F cell contains fel and the I cell is empty, and when the tester enters something in the I cell the red color goes away.
This is what I've done so far:
=IF(AND(F5="Fel",I5=ISEMPTY(TRUE)),)
which I use with conditional formatting but I'm unable to get it to work. Also the cell values are hard coded, how could i make the condition be valid for a certain column with a corresponding row's cell.
Also, I'm open to suggestions if there is a better way then to just color that cell red to make the user aware of that he needs to enter something in the I column
I am taking the example of Cells F1:F10. Please amend as applicable.
There is no formula as ISEMPTY. Use ISBLANK
Use this formula
=AND($F1="Fel",ISBLANK($I1))
To ensure that it works for all cells in that range (F1:F10) use $ for the column only thereby making it constant and the row a variable
Screenshot

Resources