# IF Statement with multiple line item

#### shahid5788

##### Board Regular
Hi,

Can you please assist with an IF statement that would have multiple conditions for analysis.

I currently have 3 customers with an associated Part Number. I am trying to find a IF statement that would say if customer ex.A,B,C price is within \$10 of each other then "Yes" if not "No". I have listed what I wanted below.

 Customer Name Part Number Price Me Unit If Statement what I WANT AES Electrical, Inc. (Platinum Pkg) 5C908 13 Yes FRESNO, City of 5C908 20 Yes M&M Management 5C908 6.99 No

<colgroup><col span="2"><col span="2"><col span="2"><col></colgroup><tbody>
</tbody>

### Excel Facts

Repeat Last Command
Pressing F4 adds dollar signs when editing a formula. When not editing, F4 repeats last command.

#### jtakw

##### Well-known Member
Hi,

Isn't M&M price within \$10 of AES (\$6.99 vs \$13)?

#### gaz_chops

##### Well-known Member
Isn't 6.99 within \$10 of 13?

#### shahid5788

##### Board Regular
I apologize I meant \$20 so all with "No". That was a TYPO

#### shahid5788

##### Board Regular

I apologize I meant \$20 so all with "No". That was a TYPO

#### shahid5788

##### Board Regular
Main thing for the formula is to analyze customer ex (A, B, C) together in 1 IF statement and have the threshold of \$20 for each of them. And if they meet within the threshold of \$20 then YES and if not then NO

#### gaz_chops

##### Well-known Member

if 20 then they will all be Yes!

#### shahid5788

##### Board Regular
So basically if Customer A is within \$20 of Customer B&C and Customer B is with \$20 of Customer A&C and lastly Customer C is with \$20 of Customer A&B

#### shahid5788

##### Board Regular
So in this case AES unit price is \$13 which is not with customer Fresno & M&M if we have threshold of \$20 applied

#### gaz_chops

##### Well-known Member
Maybe

=IF(A2="","",IF(ABS(E2-MIN(IF(\$E\$2:\$E\$40<>"",IF(\$A\$2:\$A\$40<>A2,\$E\$2:\$E\$40))))<20,"Yes","No"))

Enter as an array, Ctrl, Shift & Enter

Replies
7
Views
571
Replies
4
Views
209
Replies
1
Views
234
Replies
14
Views
708
Replies
2
Views
401