Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 42
Default LABKHAND: Problem using INDIRECT function.

Hi All,

I have the following formula in cell A1:
=NETWORKDAYS($CK3,$CK3+14,FY09_Holidays) which works fine.

I am trying to change this formula so that I can use a target cell's value
(e.g., DA2) to replace the "FY09_Holidays" string in the above networkdays
formula. So if cell DA2 has the value of FY09_Holidays, then I tried using
the INDIRECT function in cell A1 this way:

=NETWORKDAYS($CK3,$CK3+14,INDIRECT("DA2")).

This gives me a value error! Some sort of wrong data type error!

I also tried removing the quotes around DA2, but it still did not work.

If this function works, my code will be very flexible for the following
years since I can just change the value of DA2 cell to "FY10_Holidays"
without a need to change the cell formulas which use the networkdays function
all over my workbook.

I appreciate your help.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 117
Default LABKHAND: Problem using INDIRECT function.

Works fine on mine - without the quotes is the correct syntax.
=NETWORKDAYS($CK3,$CK3+14,INDIRECT(DA2))

I get #Value error if one of the cells in my defined range FY09_Holidays is
not a valid date.

"LABKHAND" wrote:

Hi All,

I have the following formula in cell A1:
=NETWORKDAYS($CK3,$CK3+14,FY09_Holidays) which works fine.

I am trying to change this formula so that I can use a target cell's value
(e.g., DA2) to replace the "FY09_Holidays" string in the above networkdays
formula. So if cell DA2 has the value of FY09_Holidays, then I tried using
the INDIRECT function in cell A1 this way:

=NETWORKDAYS($CK3,$CK3+14,INDIRECT("DA2")).

This gives me a value error! Some sort of wrong data type error!

I also tried removing the quotes around DA2, but it still did not work.

If this function works, my code will be very flexible for the following
years since I can just change the value of DA2 cell to "FY10_Holidays"
without a need to change the cell formulas which use the networkdays function
all over my workbook.

I appreciate your help.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default LABKHAND: Problem using INDIRECT function.

Get rid of the quotes around DA2. E,.g

=NETWORKDAYS($CK3,$CK3+14,INDIRECT(DA2))

Cordially,
Chip Pearson
Microsoft MVP 1998 - 2010
Pearson Software Consulting, LLC
www.cpearson.com
[email on web site]





On Fri, 15 Jan 2010 06:06:01 -0800, LABKHAND
wrote:

Hi All,

I have the following formula in cell A1:
=NETWORKDAYS($CK3,$CK3+14,FY09_Holidays) which works fine.

I am trying to change this formula so that I can use a target cell's value
(e.g., DA2) to replace the "FY09_Holidays" string in the above networkdays
formula. So if cell DA2 has the value of FY09_Holidays, then I tried using
the INDIRECT function in cell A1 this way:

=NETWORKDAYS($CK3,$CK3+14,INDIRECT("DA2")).

This gives me a value error! Some sort of wrong data type error!

I also tried removing the quotes around DA2, but it still did not work.

If this function works, my code will be very flexible for the following
years since I can just change the value of DA2 cell to "FY10_Holidays"
without a need to change the cell formulas which use the networkdays function
all over my workbook.

I appreciate your help.

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Indirect function problem jack[_2_] Excel Discussion (Misc queries) 5 February 27th 09 02:40 AM
problem with indirect Sam Excel Discussion (Misc queries) 7 November 27th 08 04:01 AM
problem using the INDIRECT function hot dogs Excel Discussion (Misc queries) 2 November 6th 06 10:09 AM
Fundamental problem with Indirect function JohnM[_4_] Excel Programming 8 September 22nd 06 01:48 AM
I have a problem fillling series with indirect function milkman Excel Worksheet Functions 4 January 28th 06 10:35 PM


All times are GMT +1. The time now is 07:10 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"