Contional on Excel - excel-formula

I need to set A or B to Excel B7 depends on different conditional. For the following one, I should get A but I get B in B7. Anyone could help to see what is the issue please?
Condition1: B6>B3
Condition2: B3>30mins

& is the short form for concatenate. You cannot have multiple condition in a single argument in excel. The correct form for an AND function would be:
=IF(AND(B6>B3,B3>TIME(0,30,0)),"A","B")
And B3 has to be a time stored in excel format, not just text that looks like time. You can test this with =ISNUMBER(B3) and it should return true. If it returns false you will need to convert your time as text to an excel format.

Related

change cell format to general or text?

we have sort of data in excel like this ---> 34:5:20
excel likes to consider it as time or date.
here is the problem because I know it's not a date and what ever action I want to do with it again
excel thinks it's a date/time value .
how can I stop this behavior ?
(each of the ':' delimited values has a special meaning to me but not date/time)
thanks a lot.
There is one option though, you can use the formula below, to convert the dates back to your format
=CONCAT(" ",TEXT(A2,"[h]:mm:ss"))
I am adding a space using concat function just so that if you ever decide to convert all to value, it will not return back to dates
I found the solution finally .
copy column to notepad.
select another column
change it's format cell to text.
now paste from notepad.
now my data is considered as text and I can separate the values using "column to text" from DATA tab.
thank you all for your valuable time.

In Excel which formula can write that would easily identify if my output condition is true or false

I am trying to do an excel formula calculated response in regards to comparing the values of three cells.
I have three cells and if one or more cell is populated with a value of greater than "0" I want it to return mix and if false ignore
Yes, actually you're correct you'll need to use COUNTIF or IF. The function IF should be good enough depending on your formula.
Please try to use the formula how I had in illustrated in my image. =IF(D3>TODAY(),"YES","NO"), your formula would be different depending on your values or if you're using dates.
If you're not using dates you can still just use IF plus the AND functions like this "=IF(AND(B3,C3,D3)<="","TRUE","FALSE")", see my linked file to see how I did it. Good luck!
Tip, you can check for "0"(a number) or ""(which means blank).
Check Value in 3 Cells for TRUE-FALSE example in excel.
Screenshot that might help understand how I use '=IF(AND...' Functions to do just what you originally asked.
To answer the revision to your question I would recommend referencing Microsofts resource on CONCAT function Combine text and numbers
Conversely, I've worked out an example for you. =IF(E4>0,(CONCAT("YES: B4:D4 ="," ",(TEXT(C4,"MM/DD/YY"))," + ",(TEXT(D4,"MM/DD/YY"))," + ",D4," Total Days")),"NO") which references my example screen shot here:
The use of "IF" plus the "CONCAT" function to return the mix of three or more cell values.

Excel IF with text as option for cell as well as numbers

I'm trying to write an IF statement for Excel which is based on:
IF E93>E88 put Yes
IF E93<E88 put No
E93 can also be have the text N/A in it based on some earlier calculations
If E93 has N/A in it then I want this new IF function to put N/A as well as the output into this new cell.
If have so far:
=IF(AND(E93>E88,"Yes"),IF(E93<E88,"No"),"N/A")
But I get a VALUE# error when E93 has the text N/A which is itself put there by another IF function. The function putting N/A into E93 is:
=IF((E81>=E84),E81-E84,"N/A")
Any suggestions would be most welcome
try:
=if(e93="N/A","N/A",if(e93>e88,"Yes",if(e93<e88,"No")))
Since you have not defined what should happen if e93=e88, note that this formula will return FALSE if e93 <> "N/A" and e93=e88
Not entirely sure if you will need to look out for this from the context of your question. But you may want to be explicit in the out put if the 2 cells are equal.
For example this would make 2 equal cells come out “No”
=IF(ISNA(E93),NA(),IF(E93>E88,”Yes”,“No”))
If a different output should be given for equal cells;
=IF(ISNA(E93),NA(),IF(E93>E88,”Yes”,IF(E93<E88,“No”,”Equal”)))
You can't perform relational operations on a text value "N/A", except '='. Thats why you are getting an error.
Try this formula :
=IF(E93="N/A","N/A",IF(E93>E88,"Yes","No"))
By this formula, first of all, it will be checked whether cell E93 contains "N/A" or not. If not, we can safely use relational operators on it.

Convert text date/time to a real date time in excel

My data is extracted from an application and it has a text that looks like a date/time in excel. How do I actually convert "3/24/2016 11:22:07 PM" (in text) to a real date/time conversion? I've tried formatting the cells but it doesn't work.
For a date conversion:
=DATEVALUE(TEXT(A1,"MM/DD/YYYY"))
For a time conversion:
=TIMEVALUE(TEXT(A1,"HH:MM:SS"))
For datetime conversion:
=DATEVALUE(TEXT(A1,"MM/DD/YYYY"))+TIMEVALUE(TEXT(A1,"HH:MM:SS"))
Where A1 has the data you wish to convert.
By the way, then you may wish to format the cell to a date/time or whatever.
Hope that helps.
1) try using the DATEVALUE function and see if that works for you.
2) A more reliable way, since datevalue does not always work is to strip the text out manually and insert it into and excel date value. You are going to want to use a combination of the following functions:
DATE
TIME
IF
FIND
MID
LEFT
RIGHT
LEN
Now in my opinion the easiest way to do this is to work with multiple helper columns to build out all the steps. One column per step. When you get your final answer, you can substitute or copy paste your formulas from the helper columns into the final formula until you are left with one variable. The reason I say this is that the final formula referring to only 1 variable gets rather lengthy/ugly and very hard to trouble shoot if you make a typo, forget a bracket or something goes wrong. When I did this approach I used a totally of 14 columns (includes final formula). When I packed it all up into 1 formula it resulted in this:
DATE(RIGHT(LEFT(A3,FIND(" ",A3)-1),4),LEFT(LEFT(A3,FIND(" ",A3)-1),FIND("/",LEFT(A3,FIND(" ",A3)-1))-1),MID(LEFT(A3,FIND(" ",A3)-1),FIND("/",LEFT(A3,FIND(" ",A3)-1))+1,FIND("/",LEFT(A3,FIND(" ",A3)-1),FIND("/",LEFT(A3,FIND(" ",A3)-1))+1)-FIND("/",LEFT(A3,FIND(" ",A3)-1))-1))+TIME(LEFT(RIGHT(A3,LEN(A3)-FIND(" ",A3)),FIND(":",RIGHT(A3,LEN(A3)-FIND(" ",A3)))-1)+IF(AND(LEFT(RIGHT(A3,LEN(A3)-FIND(" ",A3)),FIND(":",RIGHT(A3,LEN(A3)-FIND(" ",A3)))-1)<12,RIGHT(RIGHT(A3,LEN(A3)-FIND(" ",A3)),2)="AM"),0,12),MID(RIGHT(A3,LEN(A3)-FIND(" ",A3)),FIND(":",RIGHT(A3,LEN(A3)-FIND(" ",A3)))+1,FIND(":",RIGHT(A3,LEN(A3)-FIND(" ",A3)),FIND(":",RIGHT(A3,LEN(A3)-FIND(" ",A3)))+1)-FIND(":",RIGHT(A3,LEN(A3)-FIND(" ",A3)))-1),MID(RIGHT(A3,LEN(A3)-FIND(" ",A3)),FIND(":",RIGHT(A3,LEN(A3)-FIND(" ",A3)),FIND(":",RIGHT(A3,LEN(A3)-FIND(" ",A3)))+1)+1,2))
Note it is set up using cell A3 as the one with the time as text that needs formatting.
3) You should also be able to use excel's text to column function located on the DATA ribbon about half way across.
4) And of course there will be a way to code it through VBA as an option as well.
=DATEVALUE(A1)+TIMEVALUE(A1) seems to work as well, since each function only returns the value corresponding to what it recognizes in the string. That is, DATEVALUE() ignores the time component, while TIMEVALUE() ignores the date component.

what is this value means 1.845E-07 in excel?

I am reading the excel sheet from C# by using interop services. My sheet has one of cell value as 0.00. but run time when I am checking the value of that cell in C# code I am getting "1.845E-07" this value. When I check in excel sheet, on that cell right clicked , say format cell I got "1.845E-07" value in sample section. How to get exact value?
Please help me. The code is huge, so I can't provide it here.
that line is:
if (Convert.ToString(((Excel.Range)worksheet.Cells[iRowindex, colIndex_q10]).Value2) != string.Empty)
{
drRow[dtSourceEXLData.Columns[constants.Floor]] = ((Excel.Range)worksheet.Cells[iRowindex, colIndex_q10]).Value2.ToString();
}
Same problem with Date cells "39448". what does this means??please help....
1.84E-07 is the exact value, represented using scientific notation, also known as exponential notation.
1.845E-07 is the same as 0.0000001845. Excel will display a number very close to 0 as 0, unless you modify the formatting of the cell to display more decimals.
C# however will get the actual value from the cell. The ToString method use the e-notation when converting small numbers to a string.
You can specify a format string if you don't want to use the e-notation.
Highlight the cells, format cells, select Custom then select zero.

Resources