Simple formula that is driving me mad

churmie

New Member
Joined
Jan 9, 2014
Messages
44
[TABLE="width: 500"]
<tbody>[TR]
[TD][/TD]
[TD]A[/TD]
[TD]B[/TD]
[TD]C[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD][/TD]
[TD]Sales[/TD]
[TD]Closing Stock[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]12/Dec[/TD]
[TD]25[/TD]
[TD]75[/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]13/Dec[/TD]
[TD]30[/TD]
[TD]45[/TD]
[/TR]
[TR]
[TD]4[/TD]
[TD]14/Dec[/TD]
[TD]45[/TD]
[TD]0[/TD]
[/TR]
[TR]
[TD]5[/TD]
[TD]15/Dec[/TD]
[TD]60[/TD]
[TD]-160[/TD]
[/TR]
[TR]
[TD]6[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]7[/TD]
[TD]Opening Stock[/TD]
[TD]100[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]8[/TD]
[TD]Runout[/TD]
[TD]????[/TD]
[TD]Needs to return 14/Dec[/TD]
[/TR]
</tbody>[/TABLE]

How do I get cell B8 to return the date 14/Dec as the date stock runs out? I have used IF formula but I am doing something wrong?

Thanks in advance...

Churmie
 

Excel Facts

Create a chart in one keystroke
Select the data and press Alt+F1 to insert a default chart. You can change the default chart to any chart type
try this, confirm with shift-enter-return

=INDEX(A2:A5,MATCH(SMALL(IF(C2:C5>=0,C2:C5),1),C2:C5,0))
 
Upvote 0
You can get it with something like this:

=INDEX(A2:A5, MATCH(0, C2:C5, 0))

But it might just help to elaborate on if you are going to get more of this stock in the future and add it onto the bottom of this list?
 
Upvote 0
You can get it with something like this:

=INDEX(A2:A5, MATCH(0, C2:C5, 0))

But it might just help to elaborate on if you are going to get more of this stock in the future and add it onto the bottom of this list?


Excellent! I thought it might be an index question, thank you all all!
 
Upvote 0
That one is the least robust. It only works if your closing stock goes down to exactly zero. It appears to me your stock can go negative so i wouldnt use that one.
 
Upvote 0
That one is the least robust. It only works if your closing stock goes down to exactly zero. It appears to me your stock can go negative so i wouldnt use that one.

This is true. If this is the case then i would also recommend using one of the others provided as i was only attempting to provide when the closing stock hits exactly 0.
 
Upvote 0
this is not as simple as first look, let say you've 10 left over on the 14th, formula above yield different results


Book1
ABC
1SalesClosing Stock
212-Dec2575
313-Dec3045
414-Dec3510
515-Dec60-50
6
7Opening Stock100
8Runout14-Dec
915-Dec
10#N/A
Sheet1
Cell Formulas
RangeFormula
B9=INDEX(A2:A5,MATCH(TRUE,INDEX(C2:C5<=0,0),0))
B10=INDEX(A2:A5, MATCH(0, C2:C5, 0))
B8{=INDEX(A2:A5,MATCH(SMALL(IF(C2:C5>=0,C2:C5),1),C2:C5,0))}
Press CTRL+SHIFT+ENTER to enter array formulas.
 
Upvote 0

Forum statistics

Threads
1,223,888
Messages
6,175,207
Members
452,618
Latest member
Tam84

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