Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 21
Default IF, SUM and INDIRECT Help

To All,
  I have searched the help system and googled the net and I still cannot figure out what is happening.  I have to formula that pulls data from other worksheets depending on the date entered on my "Income Stmt" worksheet.

  The first formula works if I drop the LEFT test, but I need it because the cell may be blank or contain text.  I need to use the trim because I have a couple items that have leading spaces.  As it is, it currently returns blank not matter what the cell contains on my Budget worksheet.  Can anyone spot the problem?

=IF(TRIM(LEFT(INDIRECT("'Budget"&RIGHT(YEAR($I $1),2)&"'!A36"),1))<9, INDIRECT("'Budget"&RIGHT(YEAR($I$1),2)&"'! A36"), "")


  This formula is dependent on what is returned in the above formula and I need to trap for a blank cell, but what I have now does not work.  Can someone spot something that I have overlooked?

=SUMIF(INDIRECT("'Budget"&RIGHT(YEAR($I$1),2)& amp;"'!A:A"),$B36 <> "",INDIRECT("'Budget"&RIGHT(YEAR($I$1),2)& "'!D:D"))


Thanks in Advance.

Harry
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,886
Default IF, SUM and INDIRECT Help

Hi Harry

Because you are taking LEFT( ,1) of the value, it is returning a text value, so you need to have the comparison as being <"9"

--
Regards

Roger Govier


"Harry Stevens" wrote in message ...
To All,
I have searched the help system and googled the net and I still cannot figure out what is happening. I have to formula that pulls data from other worksheets depending on the date entered on my "Income Stmt" worksheet.

The first formula works if I drop the LEFT test, but I need it because the cell may be blank or contain text. I need to use the trim because I have a couple items that have leading spaces. As it is, it currently returns blank not matter what the cell contains on my Budget worksheet. Can anyone spot the problem?

=IF(TRIM(LEFT(INDIRECT("'Budget"&RIGHT(YEAR($I$1), 2)&"'!A36"),1))<9, INDIRECT("'Budget"&RIGHT(YEAR($I$1),2)&"'!A36"), "")


This formula is dependent on what is returned in the above formula and I need to trap for a blank cell, but what I have now does not work. Can someone spot something that I have overlooked?

=SUMIF(INDIRECT("'Budget"&RIGHT(YEAR($I$1),2)&"'!A :A"),$B36 < "",INDIRECT("'Budget"&RIGHT(YEAR($I$1),2)&"'!D:D") )


Thanks in Advance.

Harry

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default IF, SUM and INDIRECT Help

First, this is a text only newsgroup--not attachments and no html. (That light
blue font makes it difficult for me to read your post--I imagine it's difficult
for others, too.)

One problem is that =trim() and =left() both return text. So I would think that
you would want to use <"9".

But there may be better ways. It looks like you want to bring back only
numbers--if it's not a number (text or empty), then show "".

Is that correct?

=IF(ISNUMBER(-INDIRECT("'Budget"&TEXT($I$1,"yy")&"'!A36")),
--INDIRECT("'Budget"&TEXT($I$1,"yy")&"'!A36"),"")

If you really meant to just hide the 0's that are returned when the cell is
empty:

=IF(INDIRECT("'Budget"&TEXT($I$1,"yy")&"'!A36")="" ,"",
INDIRECT("'Budget"&TEXT($I$1,"yy")&"'!A36"))

(I changed the way to get the last two digits of the year. It made it easier
for me.)

I'm not sure what you're doing in the second formula.



Harry Stevens wrote:

To All,
I have searched the help system and googled the net and I still cannot
figure out what is happening. I have to formula that pulls data from other
worksheets depending on the date entered on my "Income Stmt" worksheet.

The first formula works if I drop the LEFT test, but I need it because the
cell may be blank or contain text. I need to use the trim because I have a
couple items that have leading spaces. As it is, it currently returns blank
not matter what the cell contains on my Budget worksheet. Can anyone spot the
problem?

=IF(TRIM(LEFT(INDIRECT("'Budget"&RIGHT(YEAR($I$1), 2)&"'!A36"),1))<9,
INDIRECT("'Budget"&RIGHT(YEAR($I$1),2)&"'!A36"), "")

This formula is dependent on what is returned in the above formula and I
need to trap for a blank cell, but what I have now does not work. Can someone
spot something that I have overlooked?

=SUMIF(INDIRECT("'Budget"&RIGHT(YEAR($I$1),2)&"'!A :A"),$B36 <
"",INDIRECT("'Budget"&RIGHT(YEAR($I$1),2)&"'!D:D") )

Thanks in Advance.

Harry


--

Dave Peterson
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 21
Default IF, SUM and INDIRECT Help

Roger Govier wrote:
Hi Harry

Because you are taking LEFT( ,1) of the value, it is returning a text
value, so you need to have the comparison as being <"9"

--
Regards

Roger Govier



"Harry Stevens"
wrote in message
...
To All,
I have searched the help system and googled the net and I still
cannot figure out what is happening. I have to formula that pulls
data from other worksheets depending on the date entered on my
"Income Stmt" worksheet.

The first formula works if I drop the LEFT test, but I need it
because the cell may be blank or contain text. I need to use the
trim because I have a couple items that have leading spaces. As it
is, it currently returns blank not matter what the cell contains on
my Budget worksheet. Can anyone spot the problem?

=IF(TRIM(LEFT(INDIRECT("'Budget"&RIGHT(YEAR($I$1), 2)&"'!A36"),1))<9,
INDIRECT("'Budget"&RIGHT(YEAR($I$1),2)&"'!A36"), "")


This formula is dependent on what is returned in the above formula
and I need to trap for a blank cell, but what I have now does not
work. Can someone spot something that I have overlooked?

=SUMIF(INDIRECT("'Budget"&RIGHT(YEAR($I$1),2)&"'!A :A"),$B36 <
"",INDIRECT("'Budget"&RIGHT(YEAR($I$1),2)&"'!D:D") )


Thanks in Advance.

Harry

Roger,
That was the ticket. I knew it had to be something simple.

Thanks
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 21
Default IF, SUM and INDIRECT Help

Dave Peterson wrote:
First, this is a text only newsgroup--not attachments and no html. (That light
blue font makes it difficult for me to read your post--I imagine it's difficult
for others, too.)

One problem is that =trim() and =left() both return text. So I would think that
you would want to use <"9".

But there may be better ways. It looks like you want to bring back only
numbers--if it's not a number (text or empty), then show "".

Is that correct?

=IF(ISNUMBER(-INDIRECT("'Budget"&TEXT($I$1,"yy")&"'!A36")),
--INDIRECT("'Budget"&TEXT($I$1,"yy")&"'!A36"),"")

If you really meant to just hide the 0's that are returned when the cell is
empty:

=IF(INDIRECT("'Budget"&TEXT($I$1,"yy")&"'!A36")="" ,"",
INDIRECT("'Budget"&TEXT($I$1,"yy")&"'!A36"))

(I changed the way to get the last two digits of the year. It made it easier
for me.)

I'm not sure what you're doing in the second formula.



Harry Stevens wrote:

To All,
I have searched the help system and googled the net and I still cannot
figure out what is happening. I have to formula that pulls data from other
worksheets depending on the date entered on my "Income Stmt" worksheet.

The first formula works if I drop the LEFT test, but I need it because the
cell may be blank or contain text. I need to use the trim because I have a
couple items that have leading spaces. As it is, it currently returns blank
not matter what the cell contains on my Budget worksheet. Can anyone spot the
problem?

=IF(TRIM(LEFT(INDIRECT("'Budget"&RIGHT(YEAR($I$1), 2)&"'!A36"),1))<9,
INDIRECT("'Budget"&RIGHT(YEAR($I$1),2)&"'!A36"), "")

This formula is dependent on what is returned in the above formula and I
need to trap for a blank cell, but what I have now does not work. Can someone
spot something that I have overlooked?

=SUMIF(INDIRECT("'Budget"&RIGHT(YEAR($I$1),2)&"'!A :A"),$B36 <
"",INDIRECT("'Budget"&RIGHT(YEAR($I$1),2)&"'!D:D") )

Thanks in Advance.

Harry


Dave,
Thanks...sorry about the html post. Anyway your explanation wes spot on and your and
Roger's suggestion made the second question a moot point.

Thanks
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
Allow EXCEL INDIRECT(ADDRESS()) and INDIRECT(RANGE()) functions Mike Barlow Excel Worksheet Functions 7 May 21st 23 07:42 PM
Sum Indirect BNT1 via OfficeKB.com Excel Worksheet Functions 3 April 6th 10 01:22 PM
INDEX("a"&COLUMNS(INDIRECT(A1):INDIRECT(A2)):A30,4) Dave F[_2_] Excel Discussion (Misc queries) 3 September 20th 07 08:36 PM
Using SUM with INDIRECT.EXT hmm Excel Worksheet Functions 1 January 29th 07 10:15 AM
Help with INDIRECT() Sophat Excel Discussion (Misc queries) 1 August 4th 05 09:12 PM


All times are GMT +1. The time now is 05:34 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"