IF with two conditions

Salamullah

Board Regular
Joined
Mar 28, 2011
Messages
221
Hi

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

[TABLE="width: 500"]
<tbody>[TR]
[TD]Segment[/TD]
[TD]Transmission[/TD]
[TD]Value[/TD]
[TD]Discount %[/TD]
[TD]Result[/TD]
[/TR]
[TR]
[TD]Primary
[/TD]
[TD]AUTO[/TD]
[TD]1000[/TD]
[TD]20%[/TD]
[TD]200[/TD]
[/TR]
[TR]
[TD]
Primary
<strike></strike>
[/TD]
[TD]MANUAL[/TD]
[TD]1000[/TD]
[TD]10%[/TD]
[TD]100[/TD]
[/TR]
[TR]
[TD]Secondary[/TD]
[TD]AUTO[/TD]
[TD]1000[/TD]
[TD]0%[/TD]
[TD]0[/TD]
[/TR]
[TR]
[TD]
Secondary
<strike></strike>
[/TD]
[TD]MANUAL[/TD]
[TD]1000[/TD]
[TD]0%[/TD]
[TD]0[/TD]
[/TR]
</tbody>[/TABLE]

Thanks in advance
 

Excel Facts

How can you turn a range sideways?
Copy the range. Select a blank cell. Right-click, Paste Special, then choose Transpose.
Why do you need an IF statement at all?


Excel 2016
ABCDE
1SegmentTransmissionValueDiscount %Result
2PrimaryAUTO100020%200
3PrimaryMANUAL100010%100
4SecondaryAUTO10000%0
5SecondaryMANUAL10000%0
Discount
Cell Formulas
RangeFormula
E2=D2*C2
 
Upvote 0
because column D is given as a sample to understand I have only 1st 3 columns with a fixed discount percentages
 
Upvote 0
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
2PrimaryAUTO100020%200
3PrimaryMANUAL100010%100
4SecondaryAUTO10000%0
5SecondaryMANUAL10000%0
6
Discount
 
Upvote 0
like this perhaps

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

Dave
 
Upvote 0
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
 
Upvote 0
[TABLE="width: 415"]
<colgroup><col><col><col span="4"></colgroup><tbody>[TR]
[TD]Segment[/TD]
[TD]Transmission[/TD]
[TD]Source[/TD]
[TD]Value[/TD]
[TD]Discount %[/TD]
[TD]Result[/TD]
[/TR]
[TR]
[TD]Primary[/TD]
[TD]AUTO[/TD]
[TD]Loc[/TD]
[TD="align: right"]1000[/TD]
[TD="align: right"]20%[/TD]
[TD="align: right"]200[/TD]
[/TR]
[TR]
[TD]Primary[/TD]
[TD]MANUAL[/TD]
[TD]Loc[/TD]
[TD="align: right"]1000[/TD]
[TD="align: right"]10%[/TD]
[TD="align: right"]100[/TD]
[/TR]
[TR]
[TD]Primary[/TD]
[TD]AUTO[/TD]
[TD]Imp[/TD]
[TD="align: right"]1000[/TD]
[TD="align: right"]20%[/TD]
[TD="align: right"]0[/TD]
[/TR]
[TR]
[TD]Secondary[/TD]
[TD]AUTO[/TD]
[TD]Imp[/TD]
[TD="align: right"]1000[/TD]
[TD="align: right"]0%[/TD]
[TD="align: right"]0[/TD]
[/TR]
[TR]
[TD]Secondary[/TD]
[TD]MANUAL[/TD]
[TD]Loc[/TD]
[TD="align: right"]1000[/TD]
[TD="align: right"]0%[/TD]
[TD="align: right"]0[/TD]
[/TR]
</tbody>[/TABLE]
 
Upvote 0
Can I request to add 1 more condition in the formula, column inserted in C "Source", if Imported than zero % discount
[TABLE="width: 415"]
<colgroup><col><col><col span="4"></colgroup>[TR]
[TD]Segment[/TD]
[TD]Transmission[/TD]
[TD]Source[/TD]
[TD]Value[/TD]
[TD]Discount %[/TD]
[TD]Result[/TD]
[/TR]
[TR]
[TD]Primary[/TD]
[TD]AUTO[/TD]
[TD]Loc[/TD]
[TD="align: right"]1000[/TD]
[TD="align: right"]20%[/TD]
[TD="align: right"]200[/TD]
[/TR]
[TR]
[TD]Primary[/TD]
[TD]MANUAL[/TD]
[TD]Loc[/TD]
[TD="align: right"]1000[/TD]
[TD="align: right"]10%[/TD]
[TD="align: right"]100[/TD]
[/TR]
[TR]
[TD]Primary[/TD]
[TD]AUTO[/TD]
[TD]Imp[/TD]
[TD="align: right"]1000[/TD]
[TD="align: right"]20%[/TD]
[TD="align: right"]0[/TD]
[/TR]
[TR]
[TD]Secondary[/TD]
[TD]AUTO[/TD]
[TD]Imp[/TD]
[TD="align: right"]1000[/TD]
[TD="align: right"]0%[/TD]
[TD="align: right"]0[/TD]
[/TR]
[TR]
[TD]Secondary[/TD]
[TD]MANUAL[/TD]
[TD]Loc[/TD]
[TD="align: right"]1000[/TD]
[TD="align: right"]0%[/TD]
[TD="align: right"]0[/TD]
[/TR]
[/TABLE]
In that case, shouldn't that red 20% be 0%?

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

Forum statistics

Threads
1,223,897
Messages
6,175,270
Members
452,628
Latest member
dd2

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