Simple formula in excel cell returns incorrect data.
I have a date in cell A2 and cell A3 has the formula
=Month(A2)
The cell is formatted as custom, mmmm. Regardless of date entered, A3 returns January.
U dont need to use =Month command you must to use =TEXT command it is better
=TEXT(A2;"mmmm")
Related
Is there a way to create a formula in one cell that will change the value in another cell based on some criteria, without scripting? Example: cell a1 contains a numerical value. cell b1 contains a value from a drop-down list, say, "YES,NO". If cell b1 is set to "YES" I want to remove (set to zero) the value in cell a1. What I'd like to do is have a formula in cell c1 that interrogates b1 and sets the value in a1 accordingly. Is the only way achieve this writing code and using setValue?
you cant remove it without a script. you can visually hide it in various ways. if the A1 is subject of further sum (as in your case per your comment) the sum formula can be always altered to reflect desired output. example:
if your formula is
=SUM(A1, C5, D22)
you can do
=SUM(IF(B1="YES", 0, A1), C5, D22)
Use the following on the cell you need the calculation (or zero) on:
=IF (B1="YES",0,SUM(A:A))
Using the given formula, you would do the SUM calculation for the whole Column A if the value on B1 is "YES", if not, then a 0 would be placed on the cell you put the formula on.
What I would like to do is use a excel function in one specific cell to output to the cell next to it. So as you can see in the image below I enter =TODAY(). What I would like to do is in cell c4 is used today function to enter todays date in cell 4 and in Cell d4 enter the date 3 days later. So if possible in cell c4 I would enter a function that states todays date in cell c4 and the workday 3 days later.
For versions that support Dynamic Arrays, create a formula that Spills the result you want
Example
=WORKDAY(TODAY(),{0,3})
To make the number of days offset variable, use SEQUENCE to generate the offsets
=WORKDAY(TODAY(),SEQUENCE(1,2,0,D7))
For Non-Dyanamic Array versions, the first formula could also be entered as a array formula (CSE) into C4:D4
If you only ever want to use Today() as the starting date, you can use this:
=TEXT(TODAY(),"ddd, dd-MM-yyyy")&" - next workday: "&TEXT(WORKDAY(TODAY(),3)," dddd")
If you want the user to enter a date, that entry must be in a different cell, and you need to replace the Today() function in the formula above with that cell reference.
I am trying to set a cell to only display a date if there's a date in the reference cell. The date displayed needs to be exactly 1 year later so I'm using the following formula in cell C3:
=IF(B3="","","=DATE(YEAR(B3)+1,MONTH(B3),DAY(B3)")
The desired result is that if there is a date in B3, a date 1 year later will appear in C3. If there is no date in B3, C3 will remain blank.
If you're typing into a cell there are no speech marks -
=IF(B3="","",Date(year(b3)+1,month(b3),day(b3)))
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.
I am using the following SUMIFS() function:
=SUMIFS(A:A, B:B, C1)
Column B:B contains dates in the following format:
2014-01-01 01:14:44
Now in cell C1 I'm not sure how to format the date so that it will grab all records that match all records that fit what's in cell C1. I have the following:
2014-01-01
but it return nothing. How do it make it so that it grabs the date, but doesn't discriminate the time portion?
You can leave C1 as a date and the data as it is - just change your formula to the following
=SUMIFS(A:A,B:B,">="&C1,B:B,"<"&C1+1)
Excel stores dates as integers, times are simply fractions of the day so every C1 date (no matter what time) falls somewhere between C1 and C1+1. This formula gets that data
The simplest way may be to keep your formula as is, other than changing C1 to D1, but insert a column immediately to the right of A with:
=INT(C1)
copied down to suit.