IF AND OR excel statement

IF AND OR Statement, not working need help

  • IF AND or OR function is not giving correct result, need help

    Votes: 0 0.0%
  • IF Logical function

    Votes: 0 0.0%

  • Total voters
    0

NK123

New member
Joined
Apr 7, 2018
Messages
15
Reaction score
0
Points
0
Dear Experts,

I am hoping to get help from this forum, see below my comment and the work book attached.
If D5, E5, F5, G5, H5... = C,Z,"" give "Comp"
if there is any other values other than or along with C,Z,"" in cell D5, E5, F5, G5, H5... then give "No". for example if any the cells contains O,I,C,Z,"" then give "No"

here is my formula working which is not working. Please see formulas Col. P Q R in sheet 1
IF(OR(D5="C",E5="C",F5="C",G5="C",H5="C",I5="C",J5="C",K5="C"),IF(OR(D5="",E5="",F5="",G5="",H5="",I5="",J5="",K5=""),IF(OR(D5="z",E5="Z",F5="Z",G5="Z",H5="Z",I5="Z",J5="Z",K5="Z"),"Complete","No")))

Thank you folks.View attachment IF OR AND Formula fix.xlsx
 
You are using the OR function so this is conradictory:

If D5, E5, F5, G5, H5... = C,Z,"" give "Comp"
if there is any other values other than or along with C,Z,"" in cell D5, E5, F5, G5, H5... then give "No". for example if any the cells contains O,I,C,Z,"" then give "No"

Please attach the workbook again, but this time fill column P manually with the results you want.

You are using the OR
 
ALiGW, Thank you for your prompt reply.
Column P is manually filled.

Thank you for help
 

Attachments

  • IF OR AND Formula fix v1.xlsx
    151.4 KB · Views: 18
Last edited:
No, I did not ask you to start a poll!

I asked you to add manually entered expected results to your workbook and then attach it again here.

I have closed the poll.
 
I not understanding about the poll, what is this. Is it different to thread I have created?
 
Last edited:
Look at the top of the thread - you must have added it when you started the thread.

No matter - just forget it now. I will look at your attachment tomorrow.
 
Look at the top of the thread - you must have added it when you started the thread.

No matter - just forget it now. I will look at your attachment tomorrow.

Thank you AliGW.
 
The attachment hasn't changed - you haven't done what I asked in post #2.

I need to know what you are aiming for.
 
The attachment is in my Post #4 and in this post too (In column only P I have manually input the result I want) , the file name has v1 at the end.
I need "complete" if there is only C,Z or "" in cell D5 to O5, otherwise "No"

Thank you
 

Attachments

  • IF OR AND Formula fix v1.xlsx
    151.4 KB · Views: 10
Sorry - I somehow missed post#4.

Try this copied down:

=IF(SUM(COUNTIF($D5:$O5,{"C","Z",""}))=12,"Complete","No")

or this:

=IF(SUM(COUNTIF($D5:$O5,{"C","Z",""}))=COLUMNS($D5:$O5),"Complete","No")
 
Last edited:
Its good. I would not have fig it out this formulas..
Have a question, instead of selecting $D5:$O5, is it possible to choose cells individually for eg D5, F5, G5, I5 etc.. what would be the formula?
I was trying to tweak your formula but not working from me.
thank you
 
Why would you want to do that? I hope you are not Saying that your real data is not like the sample data you provided?

I'm not going to advise unless you share another workbook that shows the layout of the real data you want to use this with. There may be an easy fix, but I'd have to see.

Please bear in mind in future that we provide solutions based on your sample data: if that is not realistic, then you are not going to get the solution you need. We can't see what's not there!
 
Sorry, for the confusion and more work.

See attached the workbook: Student v2. these are the real data.

your 1st formula is on col AB. My manual input (the result i am expecting) is on col AC.
The additional cols. are "student" col and "S. Name" which were not in my previous workbooks, student col are added after every month col.
In new formula I want to include only cells i.e. month: D5, F5, H5... etc ( jan to dec) (not Student amount).

Thank you
 

Attachments

  • Stundet v2.xlsx
    221 KB · Views: 7
You can use this:

=IF(SUM(COUNTIF($D5:$AA5,{"C","Z",""}))-COUNTIFS($D$4:$AA$4,"Student",$D5:$AA5,"")>=12,"Complete","No")

Please note:

1. You do not need a + sign at the start of this forumla (I don't know why you added one, but it is not necessary).
2. Do not change the end of the range back to column Z - if you do, it won't work.
 

Attachments

  • Student v2 AliGW.xlsx
    93 KB · Views: 8
Last edited:
Once again, it would be nice to know whether or not this worked for you.
 
Back
Top