Hard to believe I am unable to get this right.
I simply want to have column H show the days between "start date" column A and "sale date" column B, covering about 100 rows.
Thanks in advance!
Patrick
Hard to believe I am unable to get this right.
I simply want to have column H show the days between "start date" column A and "sale date" column B, covering about 100 rows.
Thanks in advance!
Patrick
Hi, welcome to the forum
A few questions...
Are the dates real dates or just text looking like dates? Test with =ISNUMBER(cell-ref) FALSE = text
What have you already tried, and what were the results?
Can you upload a sample workbook, showing wjhat you have and what you want?
A B C D 1 1/15/2015 1/25/201510 days
D1=DATEDIF(A1,B1,"md")&" days"
1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
2. If your question is resolved, mark it SOLVED using the thread tools
3. Click on the star if you think someone helped you
Regards
Ford
actual page.png
false
Perhaps you missed this part...
Can you upload a sample workbook, showing wjhat you have and what you want?
Hmmm....how do you "upload a sample workbook"? Is the uploaded pic not sufficient? I simply want column H to show days between a start date in column A and and end date in column B.
Sorry...
To attach a file to your post,
click advanced (next to quick post),
scroll down until you see "manage file",
click that and select "add files" (top right corner).
click "select files" find your file, click "open" click "upload" click 'done" bottom right. click "submit reply"
Once the upload is completed the file name will appear below the input boxes in this window.
You can then close the window to return to the new post screen.
Ok....Hope this is correct
Thanks for the file.
Did you try my formula from post #2?
yes....FALSE
It worked fo rme....
A B C D E F G H 1 Date Listed Date Sold Desrciption Craigslist Starting Price Selling Price 2 1/4/2015 1/5/2015 Entertainment Center$ 60.00 $ 60.00 1 days 3 1/4/2015 Massage Chair Leather Masage Chair$ 40.00 Not Sold Yet 4 1/5/2015 1/13/2015 Arm Chair$ 10.00 $ 10.00 8 days 5 1/5/2015 1/13/2015 Stainless Steel Faucet$ 80.00 $ 80.00 8 days 6 1/5/2015 1/12/2015 Golf Couch$ 20.00 $ 20.00 7 days
I modified it a bit to test for missing dates...
H2=IF(B2="","Not Sold Yet",DATEDIF(A2,B2,"md")&" days")
copied down
(aahh wait, you probably either put that in H1, or in H2, but did not adjust the cell refs?)
I can get a simple formula to work for any single row, For instance, H2=B2-A2. I just want to apply this to all rows. Of course, I want to add what is necessary to generate an item not sold result when applicable.
It's working. That's awesome! How do you come of with the "code"? Surely not trial and error.?.?.?.?
I greatly appreciate your help!!!
no, not quiteThis 1 is all based on...
DATEDIF(A2,B2,"md")
It takes the difference between the 2 dates (start date, end date) and expresses it as a numeric - I added Days to make it pretty
Because not all rows have an "end" date, I added some error-trapping...
=IF(B2="","Not Sold Yet",.....
This post has is very useful. Thank you Patrick and for the very helpful replies.
The Datedif function is also very useful for accurately calculating age in years.
See
http://www.microsofttraining.net/tip...-function.html
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks