Nested if

shes_ohwsome

New Member
Joined
Apr 24, 2017
Messages
13
Hi Everyone,

I need help about nested if. I have set of conditions that needs to be followed, unfortunately I dont know how to do it in Excel. Please help :(

[TABLE="width: 500"]
<tbody>[TR]
[TD]WH Stocks[/TD]
[TD]Recommended[/TD]
[TD]Stocklogic[/TD]
[TD]Expected output[/TD]
[/TR]
[TR]
[TD]100[/TD]
[TD]50[/TD]
[TD]10[/TD]
[TD]Recommended[/TD]
[/TR]
[TR]
[TD]100[/TD]
[TD]110[/TD]
[TD]50[/TD]
[TD]Stocklogic[/TD]
[/TR]
[TR]
[TD]100[/TD]
[TD]10[/TD]
[TD]50[/TD]
[TD]Stocklogic[/TD]
[/TR]
[TR]
[TD]0[/TD]
[TD]100[/TD]
[TD]50[/TD]
[TD]0[/TD]
[/TR]
</tbody>[/TABLE]

[TABLE="width: 418"]
<tbody>[TR]
[TD="width: 418"]Conditions:
[TABLE="width: 418"]
<tbody>[TR]
[TD="width: 418"][TABLE="width: 665"]
<tbody>[TR]
[TD="width: 665"]1. If Stocklogic is higher than Recommended Get Stocklogic value
[TABLE="width: 665"]
<tbody>[TR]
[TD="width: 665"]2. If Recommeded is higher than stocklogic GET Recommended value
[TABLE="width: 665"]
<tbody>[TR]
[TD]3. If Recommended is higher than WH stocks get Stocklogic value[/TD]
[/TR]
[TR]
[TD]4. If WH Stocks is 0 Final should be 0[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[/TR]
</tbody>[/TABLE]
 

Excel Facts

Pivot Table Drill Down
Double-click any number in a pivot table to create a new report showing all detail rows that make up that number
Only the condition is missing if Recommended = Stocklogic

Try this


Book1
ABCD
1WH StocksRecommendedStocklogicExpected output
21005010Recommended
310011050Stocklogic
41001050Stocklogic
50100500
Hoja5
Cell Formulas
RangeFormula
D2=IF(A2=0,0,IF(B2>A2,$C$1,IF(B2>C2,$B$1,$C$1)))
 
Upvote 0
or try this =IF(A2=0,0,IF(OR(C2>B2,B2>A2),C2,IF(B2>C2,B2,)))

But what answer do you want if there is equality between any of them?
 
Upvote 0
or try this =IF(A2=0,0,IF(OR(C2>B2,B2>A2),C2,IF(B2>C2,B2,)))

But what answer do you want if there is equality between any of them?

Here is the updated:
WH StocksRecommendedStocklogicExpected output
1005010Recommended
10011050Stocklogic
1001050Stocklogic
0100500
1001010Stocklogic or Recommended
101010Stocklogic -2
10104Stocklogic
Also like to put limit , if any of the result is >100 , result should be 100.
 
Upvote 0

Forum statistics

Threads
1,223,903
Messages
6,175,289
Members
452,631
Latest member
a_potato

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