Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 24
Default Make formula more simple --- array?

Hi group,

I just have a quick question. I understand arrays (mostly?) and have
found their use extremely convenient especially when typing out a
"megaformula". However, I have this situation that has been bugging me
lately in my various Excel work.

Take the following formula: =IF (OR (W4 = "FAIL", W8 = "FAIL", W13 =
"FAIL"), "FAIL", "PASS")

That works perfectly, but it becomes a hassle when there's more than 3
values I'm comparing.

Of course this can also be written: =IF (AND (W4 = "PASS", W8 =
"PASS", W13 = "PASS"), "PASS", "FAIL")

Same thing, works perfectly, but also becomes a hassle when there's
more than 3 cells I'm comparing.

What I'm looking for is a way to shorten this formula, like an array
does with countless AND() functions. (W4:W8 -- except in this case the
cells are not next to eachother) Make sense? Is that possible?

Thank you in advance,
Nikki

  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 92
Default Make formula more simple --- array?

Hi Nikki,

If your cells are adjacent:
=IF(SUMPRODUCT(--(A1:A20="PASS"))=COUNTA(A1:A20),"PASS","FAIL")
=IF(SUMPRODUCT(--(A1:A20="FAIL"))0,"FAIL","PASS")

If not, array-enter for example:
=IF(SUM(--(A1="FAIL"),--(A7="FAIL"),--(A9="FAIL"))0,"FAIL","PASS")

Regards,
Bernd

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 10,593
Default Make formula more simple --- array?

=IF(SUMPRODUCT(--(T(OFFSET(W4:W100,{0,4,5,6},0,1,1))="PASS"))0,"PA SS","FAIL")

--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

"Nikki" wrote in message
oups.com...
Hi group,

I just have a quick question. I understand arrays (mostly?) and have
found their use extremely convenient especially when typing out a
"megaformula". However, I have this situation that has been bugging me
lately in my various Excel work.

Take the following formula: =IF (OR (W4 = "FAIL", W8 = "FAIL", W13 =
"FAIL"), "FAIL", "PASS")

That works perfectly, but it becomes a hassle when there's more than 3
values I'm comparing.

Of course this can also be written: =IF (AND (W4 = "PASS", W8 =
"PASS", W13 = "PASS"), "PASS", "FAIL")

Same thing, works perfectly, but also becomes a hassle when there's
more than 3 cells I'm comparing.

What I'm looking for is a way to shorten this formula, like an array
does with countless AND() functions. (W4:W8 -- except in this case the
cells are not next to eachother) Make sense? Is that possible?

Thank you in advance,
Nikki



  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 698
Default Make formula more simple --- array?

Maybe something like this?:

=SUMPRODUCT(--(ROW(W4:W27)={4,8,13,16,22,27})*(W4:W27="PASS"))

Is that something you can work with?
***********
Regards,
Ron

XL2002, WinXP


"Nikki" wrote:

Hi group,

I just have a quick question. I understand arrays (mostly?) and have
found their use extremely convenient especially when typing out a
"megaformula". However, I have this situation that has been bugging me
lately in my various Excel work.

Take the following formula: =IF (OR (W4 = "FAIL", W8 = "FAIL", W13 =
"FAIL"), "FAIL", "PASS")

That works perfectly, but it becomes a hassle when there's more than 3
values I'm comparing.

Of course this can also be written: =IF (AND (W4 = "PASS", W8 =
"PASS", W13 = "PASS"), "PASS", "FAIL")

Same thing, works perfectly, but also becomes a hassle when there's
more than 3 cells I'm comparing.

What I'm looking for is a way to shorten this formula, like an array
does with countless AND() functions. (W4:W8 -- except in this case the
cells are not next to eachother) Make sense? Is that possible?

Thank you in advance,
Nikki


  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 698
Default Make formula more simple --- array?

Ooops! I only pasted part of the formula. Here's the whole thing:

=IF(SUMPRODUCT(--(ROW(W4:W27)={4,8,13,16,22,27})*(W4:W27="PASS"))=6 ,"PASS","FAIL")

Does that help?
***********
Regards,
Ron

XL2002, WinXP


"Ron Coderre" wrote:

Maybe something like this?:

=SUMPRODUCT(--(ROW(W4:W27)={4,8,13,16,22,27})*(W4:W27="PASS"))

Is that something you can work with?
***********
Regards,
Ron

XL2002, WinXP


"Nikki" wrote:

Hi group,

I just have a quick question. I understand arrays (mostly?) and have
found their use extremely convenient especially when typing out a
"megaformula". However, I have this situation that has been bugging me
lately in my various Excel work.

Take the following formula: =IF (OR (W4 = "FAIL", W8 = "FAIL", W13 =
"FAIL"), "FAIL", "PASS")

That works perfectly, but it becomes a hassle when there's more than 3
values I'm comparing.

Of course this can also be written: =IF (AND (W4 = "PASS", W8 =
"PASS", W13 = "PASS"), "PASS", "FAIL")

Same thing, works perfectly, but also becomes a hassle when there's
more than 3 cells I'm comparing.

What I'm looking for is a way to shorten this formula, like an array
does with countless AND() functions. (W4:W8 -- except in this case the
cells are not next to eachother) Make sense? Is that possible?

Thank you in advance,
Nikki




  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 24
Default Make formula more simple --- array?

On Apr 11, 10:40 am, Ron Coderre
wrote:
Ooops! I only pasted part of the formula. Here's the whole thing:

=IF(SUMPRODUCT(--(ROW(W4:W27)={4,8,13,16,22,27})*(W4:W27="PASS"))=6 ,"PASS",*"FAIL")

Does that help?



<snip


Yes, Ron, Thank you; I knew it could be done more efficiently
somehow.

Thanks to everyone else too, but this one fits my needs for this
particular problem (everything being in one row/column). :)

Nikki


  #7   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 92
Default Make formula more simple --- array?

Hi Nikki,

A little warning if you really intend to use some of the suggested
formulas:

Test them by inserting some rows between the cells you compare.

All suggestions are worth to be analyzed and one can learn quite a
lot, I think.

But some of them are vulnerable against insertions/deletions etc...

Regards,
Bernd

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
How can I make a simple check mark column? PeterB Excel Discussion (Misc queries) 5 September 20th 06 01:23 AM
Can I make a simple fill-in calculator for webpage using Excel? tggr2000 Excel Discussion (Misc queries) 0 July 12th 06 10:15 PM
Simple question- how to make X axis on bottom of chart Boon8888 Charts and Charting in Excel 2 February 8th 06 05:13 AM
Help please simple drop and drag I can't make work Anthony Excel Worksheet Functions 2 July 10th 05 06:28 AM
Make it more simple or intuitive to do simple things Vernie Charts and Charting in Excel 1 March 16th 05 04:01 AM


All times are GMT +1. The time now is 10:32 AM.

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

About Us

"It's about Microsoft Excel"