need if conditions

sakthi775

New Member
Joined
Oct 7, 2019
Messages
2
my data is

[TABLE="width: 189"]
<colgroup><col><col><col><col><col></colgroup><tbody>[TR]
[TD]Pos[/TD]
[TD]0 Subs[/TD]
[TD]1 subs[/TD]
[TD]2 sub[/TD]
[TD]Sub[/TD]
[/TR]
[TR]
[TD="align: right"]1[/TD]
[TD] [/TD]
[TD] [/TD]
[TD="align: right"]1[/TD]
[TD="align: right"]2[/TD]
[/TR]
[TR]
[TD="align: right"]2[/TD]
[TD] [/TD]
[TD="align: right"]1[/TD]
[TD="align: right"]1[/TD]
[TD="align: right"]3[/TD]
[/TR]
[TR]
[TD="align: right"]3[/TD]
[TD] [/TD]
[TD="align: right"]1[/TD]
[TD="align: right"]2[/TD]
[TD="align: right"]5[/TD]
[/TR]
</tbody>[/TABLE]

1 subs- 1 pos and 2 sub then in 1 subs ZERO and in 2 sub its 1
1 subs-1 pos and 1 sub then in 1 subs 1 and 0 subs its 1
2 subs-2 pos and 2 sub then in 1 subs 2
2 subs -2 pos and 3 sub then in 1 subs 1 and two sub 1
3 subs - 3 pos and 3 sub then in 1 subs 3
3 subs - 3 pos and 4 sub then in 1 subs 2 and two sub 1
3 subs - 3 pos and 5 sub then in 1 subs 1 and two sub 2
3 subs - 3 pos and 6 sub then in 1 subs its 3
more than 3 subs - 2 pos with more than 4 subs its 2 sub in 2 sub

Basically i need a if condition to get 1 sub and 2 sub based on pos value

2 pos means actual 4 subs need to be there if so 2 subs will be 2
2 pos with only 3 subs then 1 subs will have 1 and on in 1 subs
 

Excel Facts

Last used cell?
Press Ctrl+End to move to what Excel thinks is the last used cell.
[TABLE="width: 869"]
<tbody>[TR]
[TD]Pos[/TD]
[TD]0 Subs[/TD]
[TD]1 subs[/TD]
[TD]2 sub[/TD]
[TD]Sub[/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]=IF((D3-H3)<0,"0",D3-H3)[/TD]
[TD]=IF(H3=D3,H3,IF(H3<=D3,D3-H3))[/TD]
[TD]=IF(D3*2=H3,H3,IF(D3*2<h3,h3-d3,if(d3<=h3,"0",if(h3>(D3*2),D3))))</h3,h3-d3,if(d3<=h3,"0",if(h3>[/TD]
[TD]2[/TD]
[/TR]
[TR]
[TD]4[/TD]
[TD]=IF((D4-H4)<0,"0",D4-H4)[/TD]
[TD]=IF(H4=D4,H4,IF(H4<=D4,D4-H4))[/TD]
[TD]=IF(D4*2=H4,H4,IF(D4*2<h4,h4-d4,if(d4<=h4,"0",if(h4>(D4*2),D4))))</h4,h4-d4,if(d4<=h4,"0",if(h4>[/TD]
[TD]3[/TD]
[/TR]
[TR]
[TD]5[/TD]
[TD]=IF((D5-H5)<0,"0",D5-H5)[/TD]
[TD]=IF(H5=D5,H5,IF(H5<=D5,D5-H5,"0"))[/TD]
[TD]=IF(D5*2=H5,H5,IF(D5*2<h5,h5-d5,if(d5<=h5,"0",if(h5>(D5*2),D5))))</h5,h5-d5,if(d5<=h5,"0",if(h5>[/TD]
[TD]7[/TD]
[/TR]
</tbody>[/TABLE]
 
Upvote 0

Forum statistics

Threads
1,223,227
Messages
6,170,848
Members
452,361
Latest member
d3ad3y3

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