Array fomula logical operator help

G

Greg

Hi all,

Can someone help me with the correct syntax to accomplish the
following: I need all instances where there is a SUN in range1 and then
to count either "D" or "A" in range2.

sum(range1=Sun)+(range2="D")+(range2="A")

Thanks in advance for the help!!

Greg
 
G

Greg

Doh.... I had a lot going on in the fomula. The logic of what I
posted was a very small part of the total formula. Once I stripped it
down the basics, I did get the following to work:

Sum(range1="Sun")*(range2="D")+(range2="A")

I tried that before, but it did not work. I think I just had to much
going on and typed it wrong.

Thanks anyway.
 
G

Greg

Ok - I still need help. The fact that it was working was a fluke.

If I switch the "D" and the "A" above it does not work. I think the
data lined up in a way to make it work until I pushed the formula to
other parts of the worksheet.

Any ideas?

Much thanks,

Greg
 
J

Jerry W. Lewis

It is usually safer to copy the formula from the formula bar, to avoid
typing errors. It also makes our life easier if you have the
description of the problem in the same post with your request.

You could use either
=Sumproduct((range1="Sun")*((range2="D")+(range2="A")))
or
=Sum((range1="Sun")*((range2="D")+(range2="A")))

the second form must be array entered (Ctrl-Shift-Enter)

Jerry
 
G

Greg

Thanks Jerry. I see that the missing ( ) on the 'or' portion of the
equation was my problem.

I will keep your suggestion of repeating the issue in follow up post in
mind for the future.
 

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

Top