Formula is sending me over the edge

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

This formula works when 47780 is input into D8, however,
it does not work if C,P or 53S is in D9:
=IF(OR(AND('Appendix B'!D8="(47780)",J19-K19>0),AND(OR
('Appendix B'!D9="C",'Appendix B'!D9="P",'Appendix B'!
D9="53S"),J19-K19>0)),0,+J19-K19)

This OTHER formula works when P (just an example--same
formula is used for C and 53S.
=IF(ISNUMBER(FIND("P",'Appendix B'!D9)),'Appendix B'!D42,0)

I need to incorporte the IF(ISNUMBER(FIND("P",'Appendix B'!
D9... formula into the existing 1st formula for C,P, 53S
and can't do it.

Please help if you can. Thanks in advance.
 
If 47780 is in D8 and C, P, or 53S is in D9, what do you expect the result
to be? Your current formula evaluates as TRUE if D8 contains 47780 and/or
D9 contains C, P, or 53S. For any of these combinations, the result, in
accordance with your formula, will be 0. If D8 does not contain 47780 and
D9 does not contain C, P, or 53S then the formula evaluates as FALSE and
J19-K19 will be returned. Are you trying to come up with something else?

Also, how do you want to incorporate the ISNUMBER formula into your original
formula? What is the purpose?

Post back and maybe we can find the right answer.


--
Michael J. Malinsky
Pittsburgh, PA

"I am a bear of very little brain, and long
words bother me." -- AA Milne, Winnie the Pooh
 
Michael

Thanks for your response :) What I'm trying to accomplish
is that if D8=47780 OR D9=C or P or 53S AND if J19-K19 is
greater than 0, then return 0 (true) otherwise return +J19-
K19)(false), does this help? The problem is that in D9
the C,P could have something preceeding it (i.e., 26P),
and the 53 could have something after it rather than the
S, that is why without ISNUMBER, it doesn't recognize the
C or P or 53S? Thank you for helping.
 
Michael,

Because of your note, I had to re-think what I was doing
and Lo and Behold, I got the formula to work :) It's
below for your future reference. Thanks a million times
over.

=IF(OR(AND('Appendix B'!D8="(47780)",J19-K19>0),(ISNUMBER
(FIND("53",'Appendix B'!D9))),(ISNUMBER(FIND("C",'Appendix
B'!D9))),(ISNUMBER(FIND("P",'Appendix B'!D9)))*AND(J19-
K19>0)),0,+J19-K19)
 
Because of your note, I had to re-think what I was doing
and Lo and Behold, I got the formula to work :) It's
below for your future reference. Thanks a million times
over.

=IF(OR(AND('Appendix B'!D8="(47780)",J19-K19>0),
(ISNUMBER(FIND("53",'Appendix B'!D9))),
(ISNUMBER(FIND("C",'Appendix B'!D9))),
(ISNUMBER(FIND("P",'Appendix B'!D9)))
*AND(J19-K19>0)),0,+J19-K19)

Indenting terms with underscores, this becomes

IF(
__OR(
____AND(
______'Appendix B'!D8="(47780)",
______J19-K19>0
____),
____(ISNUMBER(FIND("53",'Appendix B'!D9))),
____(ISNUMBER(FIND("C",'Appendix B'!D9))),
____(ISNUMBER(FIND("P",'Appendix B'!D9)))*AND(J19-K19>0)
__),
__0,
__+J19-K19
)

Do you really want to apply the AND(J19-K19>0) test only when 'Appendix B'!D9
contains 'P'? That's what your formula does. Your original formula,

=IF(OR(AND('Appendix B'!D8="(47780)",J19-K19>0),
AND(OR('Appendix B'!D9="C",'Appendix B'!D9="P",
'Appendix B'!D9="53S"),J19-K19>0)),0,+J19-K19)

makes it appear you want to apply the J19-K19>0 test to all 'Appendix B'!D9
cases. Starting with your original formula, you could try

=IF(AND(J19>K19,OR('Appendix B'!D8="(47780)",
SUM(COUNTIF('Appendix B'!D9,"*"&{"C","P","53"}&"*")))),0,J19-K19)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top