IF Formula with AND and Between help please

Combat Womble

New Member
Joined
Nov 18, 2015
Messages
22
Hello.
Thank you for the help you have given me over the years - this site is my number excel reference! This time, I just can't figure it out :( I am trying to get right a small part of what will be a bigger formula.

Can you tell me whats wrong with this: Excel gives me an error message about "
=IF((AND, M2="y", R2<=.26),(L2-1.657+B2)*$V$1*1.25,"TEST")

If M = y AND R = .26 or below then [a bit of math]. If not print test.

I need the principle to work so I can create a big IF formula.

That will look something like

=IF((AND, M1=”y”, R1<=.26),[Math], IF((AND, M1=”y”, (AND, R1>=.261, R1<=.28),[Math], IF((AND, M1="y", R1>=.281),[Math], IF((AND, M1=”n”, R1<=.26),[Math], IF((AND, M1=”n”, (AND, R1>=.261, R1<=.28),[Math], IF((AND, M1="n", R1>=.281),[Math],”ERROR”))))))))))

... but have more permutantions.

y
under.19nunder.19
betweenbetween
y.20 and .23n.20 and .23
y.23 and .259n.23 and .259
y.26 and .289n.26 and .289
y.29 and .319n.29 and .319
y.32 and .349n.32 and .349
y.35 and .379n.35 and .379
y.38 and .409n.38 and .409
y.41 and .439n.41 and .439
yover.4nover.4

<tbody>
</tbody>


I have about 3.5k lines of data.

Please can you tell me what I've done wrong with the above formula. Also is there an easy way to do this? (intead of writing a very large IF formula)
 

Eric W

MrExcel MVP
Joined
Aug 18, 2015
Messages
8,976
Try:

=IF(AND(M2="y", R2<=0.26),(L2-1.657+B2)*$V$1*1.25,"TEST")


Incidentally, you should probably use some form of a LOOKUP or MATCH to go through a table like that. The resulting formula will be much simpler and easier to manage than a large nested IF.
 
Last edited:

Combat Womble

New Member
Joined
Nov 18, 2015
Messages
22
Try:

=IF(AND(M2="y", R2<=0.26),(L2-1.657+B2)*$V$1*1.25,"TEST")

Incidentally, you should probably use some form of a LOOKUP or MATCH to go through a table like that. The resulting formula will be much simpler and easier to manage than a large nested IF.
Thank you! (happy, yet annoyed, I was so close).

I am off to try and learn basics of LOOKUP and MATCH. Time for me to move on from large IF formulas.

Thank you again.
 

Forum statistics

Threads
1,081,969
Messages
5,362,477
Members
400,676
Latest member
BiochemBoi95

Some videos you may like

This Week's Hot Topics

  • populate from drop list with multiple tables
    Hi All, i have a drop list that displays data, what i want is when i select one of those from the list to populate text from different tables on...
  • Find list of words from sheet2 in sheet1 before a comma and extract text vba
    Hi Friends, Trying to find the solution on my task. But did not find suitable one to the need. Here is my query and sample file with details...
  • Dynamic Formula entry - VBA code sought
    Hello, really hope one of you experts can help with this - i've spent hours on this and getting no-where. .I have a set of data (more rows than...
  • Listbox Header
    Have a named range called "AccidentsHeader" Within my code I have: [CODE]Private Sub CommandButton1_Click() ListBox1.RowSource =...
  • Complex Heat Map using conditional formatting
    Good day excel world. I have a concern. Below link have a list of countries that carries each country unique data. [URL...
  • Conditional formatting
    Hi good morning, hope you can help me please, I have cells P4:P54 and if this cell is equal to 1 then i want row O to say "Fully Utilised" and to...
Top