Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Tourcat
 
Posts: n/a
Default How to add "IF" statements?

Here is an "IF" statement for cell E10:

=IF(OR(E10={"la","pd","ea","pdx","mc","v","pr"}),7 .75,IF(OR(F10=
{"la","pd","ea","pdx","mc","v","pr"}),7.75,IF(OR(G 10=
{"la","pd","ea","pdx","mc","v","pr"}),7.75,IF(OR(H 10=
{"la","pd","ea","pdx","mc","v","pr"}),7.75,IF(OR(I 10=
{"la","pd","ea","pdx","mc","v","pr"}),7.75,0))) ))

Is there a function to allow me to count how many times a certain text
is repeated and have that multiplied by 7.75? For example, in the
above "IF" statement, suppose E10 has "la", H10 has "v", and I10 has
"pr". I would like to have the function recognize 3 instances of text
and be multiplied by 7.75 to get 23.25 (or just have 23.25 in the cell
whenever 3 instances of text are in cells E10:I10). Any suggestions
are welcomed. Thanks.

  #2   Report Post  
Jason Morin
 
Posts: n/a
Default

One way:

=7.75*SUM(COUNTIF(E10:I10,
{"la","pd","ea","pdx","mc","v","pr"}))

HTH
Jason
Atlanta, GA

-----Original Message-----
Here is an "IF" statement for cell E10:

=IF(OR(E10={"la","pd","ea","pdx","mc","v","pr"}), 7.75,IF

(OR(F10=
{"la","pd","ea","pdx","mc","v","pr"}),7.75,IF(OR( G10=
{"la","pd","ea","pdx","mc","v","pr"}),7.75,IF(OR( H10=
{"la","pd","ea","pdx","mc","v","pr"}),7.75,IF(OR( I10=
{"la","pd","ea","pdx","mc","v","pr"}),7.75,0))) ))

Is there a function to allow me to count how many times

a certain text
is repeated and have that multiplied by 7.75? For

example, in the
above "IF" statement, suppose E10 has "la", H10 has "v",

and I10 has
"pr". I would like to have the function recognize 3

instances of text
and be multiplied by 7.75 to get 23.25 (or just have

23.25 in the cell
whenever 3 instances of text are in cells E10:I10). Any

suggestions
are welcomed. Thanks.

.

  #3   Report Post  
Max
 
Posts: n/a
Default

Try in say, J10:

=7.75*SUMPRODUCT(--NOT(ISNA(MATCH(E10:I10,{"la";"pd";"ea";"pdx";"mc"; "v";"pr
"},0))))

--
Rgds
Max
xl 97
---
GMT+8, 1° 22' N 103° 45' E
xdemechanik <atyahoo<dotcom
----
"Tourcat" wrote in message
oups.com...
Here is an "IF" statement for cell E10:

=IF(OR(E10={"la","pd","ea","pdx","mc","v","pr"}),7 .75,IF(OR(F10=
{"la","pd","ea","pdx","mc","v","pr"}),7.75,IF(OR(G 10=
{"la","pd","ea","pdx","mc","v","pr"}),7.75,IF(OR(H 10=
{"la","pd","ea","pdx","mc","v","pr"}),7.75,IF(OR(I 10=
{"la","pd","ea","pdx","mc","v","pr"}),7.75,0))) ))

Is there a function to allow me to count how many times a certain text
is repeated and have that multiplied by 7.75? For example, in the
above "IF" statement, suppose E10 has "la", H10 has "v", and I10 has
"pr". I would like to have the function recognize 3 instances of text
and be multiplied by 7.75 to get 23.25 (or just have 23.25 in the cell
whenever 3 instances of text are in cells E10:I10). Any suggestions
are welcomed. Thanks.



  #4   Report Post  
Tourcat
 
Posts: n/a
Default

Thanks that worked great, but what about the following situation. What
if, for example, cells E8:H8 were multiplied by 7.75 and cell I8 needed
to be multiplied by 4.75, can both be combined into one function for
one cell. Here is what I have for cell J8 so far, for example:

=7.75*SUMPRODUCT(--NOT(ISNA(MATCH(E8:H8,{"LA";"PD";"EA";"PDX";"MC";"V ";"PR

"},0))))

I need cell I8 to be included above, but the SUMPRODUCT would need to
be multiplied by 4.75 just for that one cell. Any suggestions? Thanks.

  #5   Report Post  
Myrna Larson
 
Posts: n/a
Default

You can shorten the formula a bit by using ISNUMBER instead of NOT(ISNA(...))
and by moving the multiplication inside the sumproduct formula (which
eliminates the need for the --), i.e.

=SUMPRODUCT(7.75*ISNUMBER(MATCH(E8:H8,{"LA";"PD";" EA";"PDX";"MC";"V";"PR"},0)))+
4.75*(ISNUMBER(MATCH(I8,{"LA";"PD";"EA";"PDX";"MC" ;"V";"PR"},0)))

Or, IF none of the cells E8:H8 will ever be blank,

=SUMPRODUCT(7.75*ISNUMBER(FIND(E8:H8,"LA/PD/EA/PDX/MC/V/PR")))+4.75*ISNUMBER(FIND(I8,"LA/PD/EA/PDX/MC/V/PR"))

On 9 Feb 2005 08:23:35 -0800, "Tourcat" wrote:

Thanks that worked great, but what about the following situation. What
if, for example, cells E8:H8 were multiplied by 7.75 and cell I8 needed
to be multiplied by 4.75, can both be combined into one function for
one cell. Here is what I have for cell J8 so far, for example:

=7.75*SUMPRODUCT(--NOT(ISNA(MATCH(E8:H8,{"LA";"PD";"EA";"PDX";"MC";"V ";"PR

"},0))))

I need cell I8 to be included above, but the SUMPRODUCT would need to
be multiplied by 4.75 just for that one cell. Any suggestions? Thanks.




  #6   Report Post  
Myrna Larson
 
Posts: n/a
Default

I'm puzzled by your comment, "whenever 3 instances of text are in cells
E10:I10". Do you mean that the cells will either be blank OR contain one of
these 7 text strings, never other text like "abc" or numbers, etc? If that is
correct, you can certainly simplify things.

=COUNTA(E10:H10)*7.75+COUNTA(I10)*4.75


On 9 Feb 2005 06:06:20 -0800, "Tourcat" wrote:

Here is an "IF" statement for cell E10:

=IF(OR(E10={"la","pd","ea","pdx","mc","v","pr"}), 7.75,IF(OR(F10=
{"la","pd","ea","pdx","mc","v","pr"}),7.75,IF(OR( G10=
{"la","pd","ea","pdx","mc","v","pr"}),7.75,IF(OR( H10=
{"la","pd","ea","pdx","mc","v","pr"}),7.75,IF(OR( I10=
{"la","pd","ea","pdx","mc","v","pr"}),7.75,0))) ))

Is there a function to allow me to count how many times a certain text
is repeated and have that multiplied by 7.75? For example, in the
above "IF" statement, suppose E10 has "la", H10 has "v", and I10 has
"pr". I would like to have the function recognize 3 instances of text
and be multiplied by 7.75 to get 23.25 (or just have 23.25 in the cell
whenever 3 instances of text are in cells E10:I10). Any suggestions
are welcomed. Thanks.


  #7   Report Post  
Max
 
Posts: n/a
Default

Thanks for the follow-through and the refinements, Myrna !
Priceless touches of experience ..
--
Rgds
Max
xl 97
---
GMT+8, 1° 22' N 103° 45' E
xdemechanik <atyahoo<dotcom
----
"Myrna Larson" wrote in message
...
You can shorten the formula a bit by using ISNUMBER instead of

NOT(ISNA(...))
and by moving the multiplication inside the sumproduct formula (which
eliminates the need for the --), i.e.


=SUMPRODUCT(7.75*ISNUMBER(MATCH(E8:H8,{"LA";"PD";" EA";"PDX";"MC";"V";"PR"},0
)))+
4.75*(ISNUMBER(MATCH(I8,{"LA";"PD";"EA";"PDX";"MC" ;"V";"PR"},0)))

Or, IF none of the cells E8:H8 will ever be blank,


=SUMPRODUCT(7.75*ISNUMBER(FIND(E8:H8,"LA/PD/EA/PDX/MC/V/PR")))+4.75*ISNUMBER
(FIND(I8,"LA/PD/EA/PDX/MC/V/PR"))

On 9 Feb 2005 08:23:35 -0800, "Tourcat"

wrote:

Thanks that worked great, but what about the following situation. What
if, for example, cells E8:H8 were multiplied by 7.75 and cell I8 needed
to be multiplied by 4.75, can both be combined into one function for
one cell. Here is what I have for cell J8 so far, for example:


=7.75*SUMPRODUCT(--NOT(ISNA(MATCH(E8:H8,{"LA";"PD";"EA";"PDX";"MC";"V ";"PR

"},0))))

I need cell I8 to be included above, but the SUMPRODUCT would need to
be multiplied by 4.75 just for that one cell. Any suggestions? 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
2 If Statements between 2 values Q John Excel Worksheet Functions 4 December 13th 04 03:37 PM
4 different if statements, not working Brian Excel Worksheet Functions 5 December 12th 04 08:17 PM
Macro to find and delete all FALSE statements Woody13 Excel Discussion (Misc queries) 3 December 8th 04 11:16 PM
Unresolved Errors in IF Statements - Errors do not show in results Markthepain Excel Worksheet Functions 2 December 3rd 04 08:49 AM
If statements Mark Excel Worksheet Functions 3 November 2nd 04 08:39 PM


All times are GMT +1. The time now is 04:27 AM.

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"