=IF Statements

%3CLINGO-SUB%20id%3D%22lingo-sub-2964155%22%20slang%3D%22en-US%22%3E%3DIF%20Statements%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2964155%22%20slang%3D%22en-US%22%3E%3CP%3EI%20am%20a%20basic%20Excel%20user%20and%20need%20assistance%20with%20using%20an%20IF%20statement.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EEssentially%20I%20am%20trying%20to%20build%20a%20quote%20sheet%20where%20the%20user%20enters%20either%20a%20S%2CM%20or%20L%20for%20the%20size%20in%20cell%20N2%2C%20which%20then%20returns%20a%20corresponding%20value%20in%20M2%20(Price)%20that%20matches%20the%20selection%20(N2)%20with%20the%20matching%20value%20in%20E2-G2%20(small%2Cmedium%2Clarge).%20I%20can%20do%20this%20for%20one%20size%20(see%20M2)%20but%20I%20cannot%20make%20it%20work%20with%20the%20multiple%20sizes%20(M3)%20if%20I%20try%20to%20use%20the%20If%20and%20OR%20functions%20which%20I%20tried%20in%20many%20combinations%20(see%20below).%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ENot%20sure%20if%20I%20should%20be%20using%20the%20IF%20statement%20with%20OR%2C%20or%20if%20I%20should%20be%20using%20the%20IF%20statement%20with%20AND.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EBasically%3B%20If%20N2%3DS%20then%20M2%3DE2%2C%20if%20N2%3DM%20then%20M2%3DF2%2C%20and%20if%20N2%3DL%20then%20M2%3DG2%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20tried%20the%20following%20with%20no%20success.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3DIF(OR(N3%3D%22S%22%2CN3%3D%22M%22%2CN3%3D%22L%22)%2CM3%3DE3*1%2CM3%3DF3*1%2CM3%3DG3*1))%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThank%20you%20in%20advance%20for%20any%20assistance.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ECheers%2C%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EDennis%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-2964155%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EFormulas%20and%20Functions%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2964246%22%20slang%3D%22en-US%22%3ERe%3A%20%3DIF%20Statements%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2964246%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F1218374%22%20target%3D%22_blank%22%3E%40Doudijk%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CPRE%20class%3D%22lia-code-sample%20language-excel-formula%22%3E%3CCODE%3E%3DINDEX(E2%3AG2%2CMATCH(N2%2C%24B%241%3A%24D%241%2C0))%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2964488%22%20slang%3D%22en-US%22%3ERe%3A%20%3DIF%20Statements%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2964488%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F1218374%22%20target%3D%22_blank%22%3E%40Doudijk%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3DIF(N2%3D%22S%22%2CE2%2CIF(N2%3D%22M%22%2CF2%2CIF(N2%3D%22L%22%2CG2)))%3C%2FP%3E%3C%2FLINGO-BODY%3E
Occasional Visitor

I am a basic Excel user and need assistance with using an IF statement.

 

Essentially I am trying to build a quote sheet where the user enters either a S,M or L for the size in cell N2, which then returns a corresponding value in M2 (Price) that matches the selection (N2) with the matching value in E2-G2 (small,medium,large). I can do this for one size (see M2) but I cannot make it work with the multiple sizes (M3) if I try to use the If and OR functions which I tried in many combinations (see below).

 

Not sure if I should be using the IF statement with OR, or if I should be using the IF statement with AND.

 

Basically; If N2=S then M2=E2, if N2=M then M2=F2, and if N2=L then M2=G2

 

I tried the following with no success.

 

=IF(OR(N3="S",N3="M",N3="L"),M3=E3*1,M3=F3*1,M3=G3*1))

 

Thank you in advance for any assistance.

 

Cheers,

 

Dennis

 

2 Replies

@Doudijk 

=INDEX(E2:G2,MATCH(N2,$B$1:$D$1,0))

 

@Doudijk 

=IF(N2="S",E2,IF(N2="M",F2,IF(N2="L",G2)))