ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Simple Formula (https://www.excelbanter.com/excel-discussion-misc-queries/195650-simple-formula.html)

[email protected]

Simple Formula
 
Hi,
I am trying to get : how many days between two columns: A contains dates,
column B contains also dates to get results on column C for example :
A B C
04.05.2008 06.07.2008 ? (how many days)

many thanks,
M.Barada
UAE

Max

Simple Formula
 
Assuming real dates in A1 & B1,
where B1's date (enddate) is later than A1's startdate
then in C1: =IF(COUNT(A1:B1)=2,B1-A1,"")
--
Max
Singapore
http://savefile.com/projects/236895
Downloads:16,000 Files:354 Subscribers:53
xdemechanik
---
" wrote:
I am trying to get : how many days between two columns: A contains dates,
column B contains also dates to get results on column C for example :
A B C
04.05.2008 06.07.2008 ? (how many days)

many thanks,
M.Barada
UAE


M Kan

Simple Formula
 
=DATE(RIGHT(C21,4),LEFT(C21,2),MID(C21,4,2))-DATE(RIGHT(B21,4),LEFT(B21,2),MID(B21,4,2))

Where C21 is your end date
B21 is your start date and I assumed your date format was month.day.year,
which may not be a good assumption.
--
Tips for Excel, Word, PowerPoint and Other Applications
http://www.kan.org/tips


" wrote:

Hi,
I am trying to get : how many days between two columns: A contains dates,
column B contains also dates to get results on column C for example :
A B C
04.05.2008 06.07.2008 ? (how many days)

many thanks,
M.Barada
UAE


KMc

Simple Formula
 
Excuse me, but why can't you simply use the formula: =SUM(B1-a1)
as long as columns A & B are formatted as dates, and C as a number?

It always works for me.

k

"M Kan" wrote:

=DATE(RIGHT(C21,4),LEFT(C21,2),MID(C21,4,2))-DATE(RIGHT(B21,4),LEFT(B21,2),MID(B21,4,2))

Where C21 is your end date
B21 is your start date and I assumed your date format was month.day.year,
which may not be a good assumption.
--
Tips for Excel, Word, PowerPoint and Other Applications
http://www.kan.org/tips


" wrote:

Hi,
I am trying to get : how many days between two columns: A contains dates,
column B contains also dates to get results on column C for example :
A B C
04.05.2008 06.07.2008 ? (how many days)

many thanks,
M.Barada
UAE


Max

Simple Formula
 
Remember to format C1 as general or number
--
Max
Singapore
http://savefile.com/projects/236895
Downloads:16,000 Files:354 Subscribers:53
xdemechanik
---


M Kan

Simple Formula
 
I ended up with a #VALUE error (2003)
--
Tips for Excel, Word, PowerPoint and Other Applications
http://www.kan.org/tips


"KMC" wrote:

Excuse me, but why can't you simply use the formula: =SUM(B1-a1)
as long as columns A & B are formatted as dates, and C as a number?

It always works for me.

k

"M Kan" wrote:

=DATE(RIGHT(C21,4),LEFT(C21,2),MID(C21,4,2))-DATE(RIGHT(B21,4),LEFT(B21,2),MID(B21,4,2))

Where C21 is your end date
B21 is your start date and I assumed your date format was month.day.year,
which may not be a good assumption.
--
Tips for Excel, Word, PowerPoint and Other Applications
http://www.kan.org/tips


" wrote:

Hi,
I am trying to get : how many days between two columns: A contains dates,
column B contains also dates to get results on column C for example :
A B C
04.05.2008 06.07.2008 ? (how many days)

many thanks,
M.Barada
UAE


Sandy Mann

Simple Formula
 
With
A B C
04.05.2008 06.07.2008 ? (how many days)


as your data the the *dates* will in fact be text not real dates. This will
gave you the #VALUE! error that you are reporting.

Try entering the data like:

A B C
04/05/2008 06/07/2008

then use the formula in C1:

=B1-A1

and then format C1 as General or Number.

--
HTH

Sandy
In Perth, the ancient capital of Scotland
and the crowning place of kings


Replace @mailinator.com with @tiscali.co.uk


"M Kan" <tipsoftheweek at gmail dot com wrote in message
...
I ended up with a #VALUE error (2003)
--
Tips for Excel, Word, PowerPoint and Other Applications
http://www.kan.org/tips


"KMC" wrote:

Excuse me, but why can't you simply use the formula: =SUM(B1-a1)
as long as columns A & B are formatted as dates, and C as a number?

It always works for me.

k

"M Kan" wrote:

=DATE(RIGHT(C21,4),LEFT(C21,2),MID(C21,4,2))-DATE(RIGHT(B21,4),LEFT(B21,2),MID(B21,4,2))

Where C21 is your end date
B21 is your start date and I assumed your date format was
month.day.year,
which may not be a good assumption.
--
Tips for Excel, Word, PowerPoint and Other Applications
http://www.kan.org/tips


" wrote:

Hi,
I am trying to get : how many days between two columns: A contains
dates,
column B contains also dates to get results on column C for example :
A B C
04.05.2008 06.07.2008 ? (how many days)

many thanks,
M.Barada
UAE






All times are GMT +1. The time now is 04:29 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com