"IF" Formula in Excel

dgal79

New Member
Joined
Dec 3, 2010
Messages
6
Hello,
I need some help please!
I am trying to create a formula in Excel 2013 that basically states, if in G2 is the text "Completed" then insert today's date in H2

This is what i have so far but it's not working!
=IF("Completed"=(J17)=TRUE,"=Today()"=(K17))

I would really appreciate the help!
 

Excel Facts

Excel Wisdom
Using a mouse in Excel is the work equivalent of wearing a lanyard when you first get to college
Try this in H2:

=IF(G2="Completed",TODAY(),"")

But be aware that TODAY() will always be the current date. You would need to use VBA if you want to keep the date (i.e. today it will display 8/15/14, tomorrow it will display 8/16/14, and so on).
 
Last edited:
Upvote 0
Thanks bbott but that doesnt work. The response is a weird number...41866 (not sure where thats pulling from). And correct...what i basically want is whenever a task is set to "Completed" I want the date it was set at.
 
Upvote 0
what i basically want is whenever a task is set to "Completed" I want the date it was set at.

The TODAY() function will always change. Regardless of when the task becomes completed, the formula will always change to the current date. I don't think that formula will do what you want it to do.....
 
Upvote 0
Oh so tomorrow the whole column that has "Completed" in it will change to the current date?

Is there anyway to do what I am asking?
 
Upvote 0
Oh so tomorrow the whole column that has "Completed" in it will change to the current date?

Is there anyway to do what I am asking?

Correct.

You can't do it with just a formula, but there are VBA solutions if you are comfortable doing that.
 
Upvote 0
I am not too familiar with the coding for VBA's but if its just an easy code for this I am willing to give it a shot. Can you help?
 
Upvote 0
I am not too familiar with the coding for VBA's but if its just an easy code for this I am willing to give it a shot. Can you help?

Sure. This code will update column H when the cell in the same row of column G is changed to completed. This is set to only work with the range "G2:G1000", which you can change if need be. To implement:

1. Copy the code below.
2. Right click on the sheet tab that you want the code to run on.
3. Click 'View Code'
4. Paste the code into the VBA window.
5. Close the VBA editor.

Code:
Private Sub Worksheet_Change(ByVal Target As Range)
    
    Dim x As Range
    Dim y As Range
    
    Set x = Range("G2:G1000")
    Set y = Intersect(Target, x)
    
    On Error GoTo 500
    If y.Value = "Completed" Then
        y.Offset(0, 1) = Date
    End If
    
500
End Sub
 
Upvote 0

Forum statistics

Threads
1,214,635
Messages
6,120,660
Members
448,975
Latest member
sweeberry

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top