If statement problem

jgold20

Board Regular
Joined
Feb 4, 2018
Messages
135
=IF(OR(A4="WL"),("0"),0) +
IF(OR(A4="BL",A4="DL",A4="LL",A4="LGL",A4="NL",A4="MDL",A4="RL",A4="WGL",A4="XL",
A4="A",A4="B",A4="CB",A4="D",A4="K",A4="V",A4="X",
A4="H",A4="L",A4="LG",A4="M",A4="MD",
A4="N",A4="Q",A4="R",A4="T",A4="W",A4="WG",A4="Y"),(A7*B7),0)

In the above statement, only BL, DL, H, LGL, MD, MDL, NL and X are performing properly. All of the others do not return any results. Any suggestions?
 

Excel Facts

What did Pito Salas invent?
Pito Salas, working for Lotus, popularized what would become to be pivot tables. It was released as Lotus Improv in 1989.
What are you trying to do here? The first if does nothing. The 2nd if will produce a7 * b7 if A4 is any of those letter combinations or 0 if not.
 
Upvote 0
What are you trying to do here? The first if does nothing. The 2nd if will produce a7 * b7 if A4 is any of those letter combinations or 0 if not.

The first if statement is so the field can be blank. The second if is only producing results for only some of them
 
Upvote 0
The first If for WL is to produce a blank result. As I stated on my initial post, A7 * B7 is only occurs for BL, DL, H, LGL, MD, MDL, NL and X.
 
Upvote 0
The first statement doesnt do anything bar adding zero to zero or zero to the multiplication so in other words nothing. Anyway how is A4 being populated? Are you sure these values that you think dont work are actually 'LL' for example? There are no other characters in there? Trailing spaces? Invisible characters? Its not possible for only some of those to work whilst others do not.
 
Upvote 0
Ok so take a value that doesnt work. eg LL. Put LL in the dropdown. Then what does this return:

=A4="LL"

Then this:

=CLEAN(TRIM(A4))="LL"
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,180
Members
453,021
Latest member
Justyna P

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top