A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Excel » Worksheet Functions
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

If statement containing today formula



 
 
Thread Tools Display Modes
  #1  
Old September 24th, 2008, 10:04 PM posted to microsoft.public.excel.worksheet.functions
Christi
external usenet poster
 
Posts: 55
Default If statement containing today formula

Hello.

I have a spreadsheet with two sets of information that I am trying to
compare. In columns D thru I, I have the kit information. In columns K thru
L, I have the order information if it is available. I pulled in the order
information with vlkp, copied and paste special text, so there isn't an
embedded formula in the data I am comparing.

The essence of what I am trying to find is the number of days that passed
before the kit was ordered. To do this, my first formula was:
=NETWORKDAYS(E2,L2)-1
E2 being the date the kit was created and L2 being the date the kit was
ordered. This worked well for the kits that had been ordered, but for the
ones that hadn't (order# in K2 is #N/A), I want to subtract it from today's
date that would be refreshed when the spreadsheet openned.

The next formula I tried was:
=IF(K2="#N/A",(NETWORKDAYS(E2,TODAY())-1),(NETWORKDAYS(E2,L2)-1))
This statement works fine for the false, but true just returns a result of
#N/A. I also tried typing =TODAY() in a cell off on the side and modifying
the formula to reference that cell, but the formula still returns #N/A for
the number of days passed if there was no order information.

I'm sure the adjustment is minor or there might even be an easier formula to
use. If someone could please help, I would appreciate it.

Thanks,
Christi
  #2  
Old September 24th, 2008, 10:08 PM posted to microsoft.public.excel.worksheet.functions
Sean Timmons
external usenet poster
 
Posts: 1,722
Default If statement containing today formula

K2 doesn't technically have a value of "#N/A". So, instead, do..

=IF(iserror(K2),(NETWORKDAYS(E2,TODAY())-1),(NETWORKDAYS(E2,L2)-1))

"Christi" wrote:

Hello.

I have a spreadsheet with two sets of information that I am trying to
compare. In columns D thru I, I have the kit information. In columns K thru
L, I have the order information if it is available. I pulled in the order
information with vlkp, copied and paste special text, so there isn't an
embedded formula in the data I am comparing.

The essence of what I am trying to find is the number of days that passed
before the kit was ordered. To do this, my first formula was:
=NETWORKDAYS(E2,L2)-1
E2 being the date the kit was created and L2 being the date the kit was
ordered. This worked well for the kits that had been ordered, but for the
ones that hadn't (order# in K2 is #N/A), I want to subtract it from today's
date that would be refreshed when the spreadsheet openned.

The next formula I tried was:
=IF(K2="#N/A",(NETWORKDAYS(E2,TODAY())-1),(NETWORKDAYS(E2,L2)-1))
This statement works fine for the false, but true just returns a result of
#N/A. I also tried typing =TODAY() in a cell off on the side and modifying
the formula to reference that cell, but the formula still returns #N/A for
the number of days passed if there was no order information.

I'm sure the adjustment is minor or there might even be an easier formula to
use. If someone could please help, I would appreciate it.

Thanks,
Christi

  #3  
Old September 24th, 2008, 10:09 PM posted to microsoft.public.excel.worksheet.functions
Peo Sjoblom[_2_]
external usenet poster
 
Posts: 963
Default If statement containing today formula

Use

=IF(ISNA(K2),(NETWORKDAYS(E2,TODAY())-1),(NETWORKDAYS(E2,L2)-1))

--


Regards,


Peo Sjoblom

"Christi" wrote in message
...
Hello.

I have a spreadsheet with two sets of information that I am trying to
compare. In columns D thru I, I have the kit information. In columns K
thru
L, I have the order information if it is available. I pulled in the order
information with vlkp, copied and paste special text, so there isn't an
embedded formula in the data I am comparing.

The essence of what I am trying to find is the number of days that passed
before the kit was ordered. To do this, my first formula was:
=NETWORKDAYS(E2,L2)-1
E2 being the date the kit was created and L2 being the date the kit was
ordered. This worked well for the kits that had been ordered, but for the
ones that hadn't (order# in K2 is #N/A), I want to subtract it from
today's
date that would be refreshed when the spreadsheet openned.

The next formula I tried was:
=IF(K2="#N/A",(NETWORKDAYS(E2,TODAY())-1),(NETWORKDAYS(E2,L2)-1))
This statement works fine for the false, but true just returns a result of
#N/A. I also tried typing =TODAY() in a cell off on the side and modifying
the formula to reference that cell, but the formula still returns #N/A for
the number of days passed if there was no order information.

I'm sure the adjustment is minor or there might even be an easier formula
to
use. If someone could please help, I would appreciate it.

Thanks,
Christi



  #4  
Old September 24th, 2008, 10:26 PM posted to microsoft.public.excel.worksheet.functions
Peo Sjoblom[_2_]
external usenet poster
 
Posts: 963
Default If statement containing today formula

If it has #N/A it might be better to use ISNA since another error type might
be of importance

--


Regards,


Peo Sjoblom

"Sean Timmons" wrote in message
...
K2 doesn't technically have a value of "#N/A". So, instead, do..

=IF(iserror(K2),(NETWORKDAYS(E2,TODAY())-1),(NETWORKDAYS(E2,L2)-1))

"Christi" wrote:

Hello.

I have a spreadsheet with two sets of information that I am trying to
compare. In columns D thru I, I have the kit information. In columns K
thru
L, I have the order information if it is available. I pulled in the order
information with vlkp, copied and paste special text, so there isn't an
embedded formula in the data I am comparing.

The essence of what I am trying to find is the number of days that passed
before the kit was ordered. To do this, my first formula was:
=NETWORKDAYS(E2,L2)-1
E2 being the date the kit was created and L2 being the date the kit was
ordered. This worked well for the kits that had been ordered, but for the
ones that hadn't (order# in K2 is #N/A), I want to subtract it from
today's
date that would be refreshed when the spreadsheet openned.

The next formula I tried was:
=IF(K2="#N/A",(NETWORKDAYS(E2,TODAY())-1),(NETWORKDAYS(E2,L2)-1))
This statement works fine for the false, but true just returns a result
of
#N/A. I also tried typing =TODAY() in a cell off on the side and
modifying
the formula to reference that cell, but the formula still returns #N/A
for
the number of days passed if there was no order information.

I'm sure the adjustment is minor or there might even be an easier formula
to
use. If someone could please help, I would appreciate it.

Thanks,
Christi



  #5  
Old September 24th, 2008, 10:28 PM posted to microsoft.public.excel.worksheet.functions
Christi
external usenet poster
 
Posts: 55
Default If statement containing today formula

Thank you both for your assistance. Both suggestions worked.

Since I copied and pasted the values of my vlkp, and the value per se was
#n/a, why would the actual value still only be na in the formula? Just a
little curious.

"Peo Sjoblom" wrote:

Use

=IF(ISNA(K2),(NETWORKDAYS(E2,TODAY())-1),(NETWORKDAYS(E2,L2)-1))

--


Regards,


Peo Sjoblom

"Christi" wrote in message
...
Hello.

I have a spreadsheet with two sets of information that I am trying to
compare. In columns D thru I, I have the kit information. In columns K
thru
L, I have the order information if it is available. I pulled in the order
information with vlkp, copied and paste special text, so there isn't an
embedded formula in the data I am comparing.

The essence of what I am trying to find is the number of days that passed
before the kit was ordered. To do this, my first formula was:
=NETWORKDAYS(E2,L2)-1
E2 being the date the kit was created and L2 being the date the kit was
ordered. This worked well for the kits that had been ordered, but for the
ones that hadn't (order# in K2 is #N/A), I want to subtract it from
today's
date that would be refreshed when the spreadsheet openned.

The next formula I tried was:
=IF(K2="#N/A",(NETWORKDAYS(E2,TODAY())-1),(NETWORKDAYS(E2,L2)-1))
This statement works fine for the false, but true just returns a result of
#N/A. I also tried typing =TODAY() in a cell off on the side and modifying
the formula to reference that cell, but the formula still returns #N/A for
the number of days passed if there was no order information.

I'm sure the adjustment is minor or there might even be an easier formula
to
use. If someone could please help, I would appreciate it.

Thanks,
Christi




  #6  
Old September 24th, 2008, 10:37 PM posted to microsoft.public.excel.worksheet.functions
Sean Timmons
external usenet poster
 
Posts: 1,722
Default If statement containing today formula

Good point. Force of habit on my part...

"Peo Sjoblom" wrote:

If it has #N/A it might be better to use ISNA since another error type might
be of importance

--


Regards,


Peo Sjoblom

"Sean Timmons" wrote in message
...
K2 doesn't technically have a value of "#N/A". So, instead, do..

=IF(iserror(K2),(NETWORKDAYS(E2,TODAY())-1),(NETWORKDAYS(E2,L2)-1))

"Christi" wrote:

Hello.

I have a spreadsheet with two sets of information that I am trying to
compare. In columns D thru I, I have the kit information. In columns K
thru
L, I have the order information if it is available. I pulled in the order
information with vlkp, copied and paste special text, so there isn't an
embedded formula in the data I am comparing.

The essence of what I am trying to find is the number of days that passed
before the kit was ordered. To do this, my first formula was:
=NETWORKDAYS(E2,L2)-1
E2 being the date the kit was created and L2 being the date the kit was
ordered. This worked well for the kits that had been ordered, but for the
ones that hadn't (order# in K2 is #N/A), I want to subtract it from
today's
date that would be refreshed when the spreadsheet openned.

The next formula I tried was:
=IF(K2="#N/A",(NETWORKDAYS(E2,TODAY())-1),(NETWORKDAYS(E2,L2)-1))
This statement works fine for the false, but true just returns a result
of
#N/A. I also tried typing =TODAY() in a cell off on the side and
modifying
the formula to reference that cell, but the formula still returns #N/A
for
the number of days passed if there was no order information.

I'm sure the adjustment is minor or there might even be an easier formula
to
use. If someone could please help, I would appreciate it.

Thanks,
Christi




  #7  
Old September 24th, 2008, 10:47 PM posted to microsoft.public.excel.worksheet.functions
Peo Sjoblom[_2_]
external usenet poster
 
Posts: 963
Default If statement containing today formula

Same here at times

--


Regards,


Peo Sjoblom

"Sean Timmons" wrote in message
...
Good point. Force of habit on my part...

"Peo Sjoblom" wrote:

If it has #N/A it might be better to use ISNA since another error type
might
be of importance

--


Regards,


Peo Sjoblom

"Sean Timmons" wrote in message
...
K2 doesn't technically have a value of "#N/A". So, instead, do..

=IF(iserror(K2),(NETWORKDAYS(E2,TODAY())-1),(NETWORKDAYS(E2,L2)-1))

"Christi" wrote:

Hello.

I have a spreadsheet with two sets of information that I am trying to
compare. In columns D thru I, I have the kit information. In columns K
thru
L, I have the order information if it is available. I pulled in the
order
information with vlkp, copied and paste special text, so there isn't
an
embedded formula in the data I am comparing.

The essence of what I am trying to find is the number of days that
passed
before the kit was ordered. To do this, my first formula was:
=NETWORKDAYS(E2,L2)-1
E2 being the date the kit was created and L2 being the date the kit
was
ordered. This worked well for the kits that had been ordered, but for
the
ones that hadn't (order# in K2 is #N/A), I want to subtract it from
today's
date that would be refreshed when the spreadsheet openned.

The next formula I tried was:
=IF(K2="#N/A",(NETWORKDAYS(E2,TODAY())-1),(NETWORKDAYS(E2,L2)-1))
This statement works fine for the false, but true just returns a
result
of
#N/A. I also tried typing =TODAY() in a cell off on the side and
modifying
the formula to reference that cell, but the formula still returns #N/A
for
the number of days passed if there was no order information.

I'm sure the adjustment is minor or there might even be an easier
formula
to
use. If someone could please help, I would appreciate it.

Thanks,
Christi






  #8  
Old September 24th, 2008, 10:55 PM posted to microsoft.public.excel.worksheet.functions
Peo Sjoblom[_2_]
external usenet poster
 
Posts: 963
Default If statement containing today formula

It's the same if you type false or true or paste them in a cell, they will
always be special
What I meant it doesn't matter if you paste or type the string, it won't be
regular text.
One thing that will show you that is the way it is aligned in the cell

TRUE, FALSE #N/A etc are center aligned whereas text is left aligned and
numbers are right aligned

Of course you need to have no alignment format in the cells in question plus
wide enough columns to see that

Only way to get a literal #N/A that can be compared to "#N/A"
is to precede it with an apostrophe or format the cell as text before it is
entered, if you type '#N/A
in A1 then this

=A1="#N/A"

should return TRUE



--


Regards,


Peo Sjoblom

"Christi" wrote in message
...
Thank you both for your assistance. Both suggestions worked.

Since I copied and pasted the values of my vlkp, and the value per se was
#n/a, why would the actual value still only be na in the formula? Just a
little curious.

"Peo Sjoblom" wrote:

Use

=IF(ISNA(K2),(NETWORKDAYS(E2,TODAY())-1),(NETWORKDAYS(E2,L2)-1))

--


Regards,


Peo Sjoblom

"Christi" wrote in message
...
Hello.

I have a spreadsheet with two sets of information that I am trying to
compare. In columns D thru I, I have the kit information. In columns K
thru
L, I have the order information if it is available. I pulled in the
order
information with vlkp, copied and paste special text, so there isn't an
embedded formula in the data I am comparing.

The essence of what I am trying to find is the number of days that
passed
before the kit was ordered. To do this, my first formula was:
=NETWORKDAYS(E2,L2)-1
E2 being the date the kit was created and L2 being the date the kit was
ordered. This worked well for the kits that had been ordered, but for
the
ones that hadn't (order# in K2 is #N/A), I want to subtract it from
today's
date that would be refreshed when the spreadsheet openned.

The next formula I tried was:
=IF(K2="#N/A",(NETWORKDAYS(E2,TODAY())-1),(NETWORKDAYS(E2,L2)-1))
This statement works fine for the false, but true just returns a result
of
#N/A. I also tried typing =TODAY() in a cell off on the side and
modifying
the formula to reference that cell, but the formula still returns #N/A
for
the number of days passed if there was no order information.

I'm sure the adjustment is minor or there might even be an easier
formula
to
use. If someone could please help, I would appreciate it.

Thanks,
Christi






  #9  
Old September 25th, 2008, 01:22 PM posted to microsoft.public.excel.worksheet.functions
Christi
external usenet poster
 
Posts: 55
Default If statement containing today formula

I had never noticed that! I love learning new things about Excel, and today
you have enlightened me a little bit more. That tidbit will come in handy in
the future, I'm sure of it.

Thanks again for all your help

"Peo Sjoblom" wrote:

It's the same if you type false or true or paste them in a cell, they will
always be special
What I meant it doesn't matter if you paste or type the string, it won't be
regular text.
One thing that will show you that is the way it is aligned in the cell

TRUE, FALSE #N/A etc are center aligned whereas text is left aligned and
numbers are right aligned

Of course you need to have no alignment format in the cells in question plus
wide enough columns to see that

Only way to get a literal #N/A that can be compared to "#N/A"
is to precede it with an apostrophe or format the cell as text before it is
entered, if you type '#N/A
in A1 then this

=A1="#N/A"

should return TRUE



--


Regards,


Peo Sjoblom

"Christi" wrote in message
...
Thank you both for your assistance. Both suggestions worked.

Since I copied and pasted the values of my vlkp, and the value per se was
#n/a, why would the actual value still only be na in the formula? Just a
little curious.

"Peo Sjoblom" wrote:

Use

=IF(ISNA(K2),(NETWORKDAYS(E2,TODAY())-1),(NETWORKDAYS(E2,L2)-1))

--


Regards,


Peo Sjoblom

"Christi" wrote in message
...
Hello.

I have a spreadsheet with two sets of information that I am trying to
compare. In columns D thru I, I have the kit information. In columns K
thru
L, I have the order information if it is available. I pulled in the
order
information with vlkp, copied and paste special text, so there isn't an
embedded formula in the data I am comparing.

The essence of what I am trying to find is the number of days that
passed
before the kit was ordered. To do this, my first formula was:
=NETWORKDAYS(E2,L2)-1
E2 being the date the kit was created and L2 being the date the kit was
ordered. This worked well for the kits that had been ordered, but for
the
ones that hadn't (order# in K2 is #N/A), I want to subtract it from
today's
date that would be refreshed when the spreadsheet openned.

The next formula I tried was:
=IF(K2="#N/A",(NETWORKDAYS(E2,TODAY())-1),(NETWORKDAYS(E2,L2)-1))
This statement works fine for the false, but true just returns a result
of
#N/A. I also tried typing =TODAY() in a cell off on the side and
modifying
the formula to reference that cell, but the formula still returns #N/A
for
the number of days passed if there was no order information.

I'm sure the adjustment is minor or there might even be an easier
formula
to
use. If someone could please help, I would appreciate it.

Thanks,
Christi






 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 08:55 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.