IF with two conditions

Salamullah

Board Regular
Joined
Mar 28, 2011
Messages
212
Hi

I need formula with if command in column E based on data from A to D, Secondary no Discount

SegmentTransmissionValueDiscount %Result
Primary
AUTO100020%200
Primary
<strike></strike>
MANUAL100010%100
SecondaryAUTO10000%0
Secondary
<strike></strike>
MANUAL10000%0

<tbody>
</tbody>

Thanks in advance
 

Peter_SSs

MrExcel MVP, Moderator
Joined
May 28, 2005
Messages
41,789
Office Version
365
Platform
Windows
Why do you need an IF statement at all?

<b>Excel 2016</b><table cellpadding="2.5px" rules="all" style=";background-color: rgb(255,255,255);border: 1px solid;border-collapse: collapse; border-color: rgb(187,187,187)"><colgroup><col width="25px" style="background-color: rgb(218,231,245)" /><col /><col /><col /><col /><col /></colgroup><thead><tr style=" background-color: rgb(218,231,245);text-align: center;color: rgb(22,17,32)"><th></th><th>A</th><th>B</th><th>C</th><th>D</th><th>E</th></tr></thead><tbody><tr ><td style="color: rgb(22,17,32);text-align: center;">1</td><td style=";">Segment</td><td style=";">Transmission</td><td style="text-align: right;;">Value</td><td style="text-align: right;;">Discount %</td><td style="text-align: right;;">Result</td></tr><tr ><td style="color: rgb(22,17,32);text-align: center;">2</td><td style=";">Primary</td><td style=";">AUTO</td><td style="text-align: right;;">1000</td><td style="text-align: right;;">20%</td><td style="text-align: right;;">200</td></tr><tr ><td style="color: rgb(22,17,32);text-align: center;">3</td><td style=";">Primary</td><td style=";">MANUAL</td><td style="text-align: right;;">1000</td><td style="text-align: right;;">10%</td><td style="text-align: right;;">100</td></tr><tr ><td style="color: rgb(22,17,32);text-align: center;">4</td><td style=";">Secondary</td><td style=";">AUTO</td><td style="text-align: right;;">1000</td><td style="text-align: right;;">0%</td><td style="text-align: right;;">0</td></tr><tr ><td style="color: rgb(22,17,32);text-align: center;">5</td><td style=";">Secondary</td><td style=";">MANUAL</td><td style="text-align: right;;">1000</td><td style="text-align: right;;">0%</td><td style="text-align: right;;">0</td></tr></tbody></table><p style="width:6.4em;font-weight:bold;margin:0;padding:0.2em 0.6em 0.2em 0.5em;border: 1px solid rgb(187,187,187);border-top:none;text-align: center;background-color: rgb(218,231,245);color: rgb(22,17,32)">Discount</p><br /><br /><table width="85%" cellpadding="2.5px" rules="all" style=";border: 2px solid black;border-collapse:collapse;padding: 0.4em;background-color: rgb(255,255,255)" ><tr><td style="padding:6px" ><b>Worksheet Formulas</b><table cellpadding="2.5px" width="100%" rules="all" style="border: 1px solid;text-align:center;background-color: rgb(255,255,255);border-collapse: collapse; border-color: rgb(187,187,187)"><thead><tr style=" background-color: rgb(218,231,245);color: rgb(22,17,32)"><th width="10px">Cell</th><th style="text-align:left;padding-left:5px;">Formula</th></tr></thead><tbody><tr><th width="10px" style=" background-color: rgb(218,231,245);color: rgb(22,17,32)">E2</th><td style="text-align:left">=D2*C2</td></tr></tbody></table></td></tr></table><br />
 

Salamullah

Board Regular
Joined
Mar 28, 2011
Messages
212
because column D is given as a sample to understand I have only 1st 3 columns with a fixed discount percentages
 

Peter_SSs

MrExcel MVP, Moderator
Joined
May 28, 2005
Messages
41,789
Office Version
365
Platform
Windows
because column D is given as a sample to understand I have only 1st 3 columns with a fixed discount percentages
Hmm, you originally said "command in column E based on data from A to D" so it certainly sounded like column D had data. ;)

So try this then

Excel Workbook
ABCDE
1SegmentTransmissionValueDiscount %Result
2PrimaryAUTO1000
3PrimaryMANUAL100010%100
4SecondaryAUTO10000%0
5SecondaryMANUAL10000%0
6
Discount
 

SQUIDD

Well-known Member
Joined
Jan 2, 2009
Messages
1,665
like this perhaps

=IF(A2="secondary",C2,D2*C2)

Dave
 

Salamullah

Board Regular
Joined
Mar 28, 2011
Messages
212
Hi thanks its working,

Can I request to add 1 more condition in the formula, column inserted in C "Source", if Imported than zero % discount
 

Salamullah

Board Regular
Joined
Mar 28, 2011
Messages
212
SegmentTransmissionSourceValueDiscount %Result
PrimaryAUTOLoc100020%200
PrimaryMANUALLoc100010%100
PrimaryAUTOImp100020%0
SecondaryAUTOImp10000%0
SecondaryMANUALLoc10000%0

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

Peter_SSs

MrExcel MVP, Moderator
Joined
May 28, 2005
Messages
41,789
Office Version
365
Platform
Windows
Can I request to add 1 more condition in the formula, column inserted in C "Source", if Imported than zero % discount
SegmentTransmissionSourceValueDiscount %Result
PrimaryAUTOLoc100020%200
PrimaryMANUALLoc100010%100
PrimaryAUTOImp100020%0
SecondaryAUTOImp10000%0
SecondaryMANUALLoc10000%0

<colgroup><col><col><col span="4"></colgroup>
In that case, shouldn't that red 20% be 0%?

Excel Workbook
ABCDEF
1SegmentTransmissionSourceValueDiscount %Result
2PrimaryAUTOLoc1000
3PrimaryMANUALLoc100010%100
4PrimaryAUTOImp10000%0
5SecondaryAUTOImp10000%0
6SecondaryMANUALLoc10000%0
Discount (2)
 

Forum statistics

Threads
1,078,230
Messages
5,338,972
Members
399,274
Latest member
WilliamWavehill

Some videos you may like

This Week's Hot Topics

Top