If Else Condition

varunwalla

New Member
Joined
Aug 13, 2020
Messages
32
Office Version
  1. 365
  2. 2019
Platform
  1. Windows
  2. Mobile
  3. Web
If column A contains buy then the value of the column d & e should be added esle part would be i.e if column a contain sell then the column d & e should be subtracted i am get to work for number i.e by using the formula after googling =IF(B2>5,C2+D2,C2-D2) i am looking for similar type or alternative / efficient way based on the text

here is the preview

Learn-IF-Condition.xlsx
ABCDEF
1Order TypeQtyPriceTotalTaxGrand Total
2Buy10252505275
3Buy5251255-100
4Buy5251255
5Sell10252505
6Sell10252505
Sheet1
Cell Formulas
RangeFormula
F2:F3F2=IF(B2>5,C2+D2,C2-D2)
D2:D6D2=(B2*C2)
 

Excel Facts

Formula for Yesterday
Name Manager, New Name. Yesterday =TODAY()-1. OK. Then, use =YESTERDAY in any cell. Tomorrow could be =TODAY()+1.
You're welcome & thanks for the feedback.
 
Upvote 0
Is it possible to highlight entire row with green color if Sell is present
 
Upvote 0
Yes you can use conditional formatting to do that.
 
Upvote 0
Book1
ABCDEF
1Order TypeQtyPriceTotalTaxGrand Total
2Buy10252505275
3Buy5251255-100
4Buy5251255
5Sell10252505
6Sell10252505
Sheet2
Cell Formulas
RangeFormula
F2:F3F2=IF(B2>5,C2+D2,C2-D2)
D2:D6D2=(B2*C2)
Cells with Conditional Formatting
CellConditionCell FormatStop If True
A2:F6Expression=IF($A2="SELL",TRUE)textNO


Conditional Fomatting
 
Upvote 0

Forum statistics

Threads
1,214,523
Messages
6,120,042
Members
448,940
Latest member
mdusw

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