Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / Worksheet Functions / October 2007

Tip: Looking for answers? Try searching our database.

CSE function with #VALUE errors

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Phillip - 04 Oct 2007 22:41 GMT
Hi,
In a column of a spreadsheet I use at work is data for the number of
transactions of different types, in a precise format (2 buy, 3 sell, 5
sell, etc). I have to total the transactions of different types, and I
thought I could get excel to do it for me. More than that, I thought a
CSE could do it in one cell, but the function seems to have become a bit
of a monster. This is my tester for it;

=SUM(IF(EXACT(RIGHT(A1:A3,LEN(A1:A3)-FIND(" ",A1:A3)),"buy"),
VALUE(LEFT(A1:A3,FIND(" ",A1:A3)-1)),0))

it sums only the numbers in cells that end in "buy". It works a charm, but
it can't handle any blank cells in the range, which makes it all but
useless for my purposes. I tried experimenting with ISERROR, but without
much luck. This is my best attempt so far;

=SUM(IF(EXACT(IF(ISERROR(FIND(" ",A1:A3)),0,
RIGHT(A1:A3,LEN(A1:A3)-FIND(" ",A1:A3))),"buy"),
IF(ISERROR(FIND(" ",A1:A3)),0,VALUE(LEFT(A1:A3,FIND(" ",A1:A3)-1))),0))

Now, if the first cell in the range is empty it still gives #VALUE, but
any other blank cell just ruins the sum and it gives 0. That's the best I
can do.

I realise now that maybe solving it inline is probably not the best way to
do it, and that I'm betraying all the laws of readability, but I'm
determined to make it work now, and I'd really like some help. Am I
barking up the wrong tree with ISERROR? Is there a better function you
know of that can help? What do you think?

thanks
P
T. Valko - 04 Oct 2007 23:12 GMT
Try this array formula (CSE):

All on one line.

=SUM(IF(ISNUMBER(SEARCH("buy",A1:A10)),
--LEFT(A1:A10,FIND(" ",A1:A10)-1)))

Signature

Biff
Microsoft Excel MVP

> Hi,
> In a column of a spreadsheet I use at work is data for the number of
[quoted text clipped - 28 lines]
> thanks
> P
Phillip - 05 Oct 2007 21:45 GMT
> Try this array formula (CSE):
>
> All on one line.
>
> =SUM(IF(ISNUMBER(SEARCH("buy",A1:A10)),
> --LEFT(A1:A10,FIND(" ",A1:A10)-1)))

Thanks. That'll make life a lot easier

P
T. Valko - 05 Oct 2007 22:41 GMT
>> Try this array formula (CSE):
>>
[quoted text clipped - 6 lines]
>
> P

You're welcome. Thanks for the feedback!

Signature

Biff
Microsoft Excel MVP

 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.