nested if

Giancar

Board Regular
Joined
Nov 29, 2017
Messages
52
Hi guys,

Not sure that title is correct, by the way I am stuck in one formula. Hopefully you can help.

This is the result I am looking for:
[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD][/TD]
[TD]week[/TD]
[TD]Month[/TD]
[TD]Month +1[/TD]
[TD]Month -1[/TD]
[TD]Forecast[/TD]
[/TR]
[TR]
[TD]a[/TD]
[TD]0[/TD]
[TD]0[/TD]
[TD]0[/TD]
[TD]500[/TD]
[TD]500[/TD]
[/TR]
[TR]
[TD]b[/TD]
[TD]0[/TD]
[TD]200[/TD]
[TD]201[/TD]
[TD]300[/TD]
[TD]200[/TD]
[/TR]
[TR]
[TD]c[/TD]
[TD]100[/TD]
[TD]0[/TD]
[TD]0[/TD]
[TD]101[/TD]
[TD]100[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]


Basically in "Forecast column" I want the first value available between column "week" and "month-1" that is not 0.
Anyone able to help?
Thank you
 

Excel Facts

Copy formula down without changing references
If you have =SUM(F2:F49) in F50; type Alt+' in F51 to copy =SUM(F2:F49) to F51, leaving the formula in edit mode. Change SUM to COUNT.
Assuming the intersection of "a" and "week" is the top left cell, "A1", Try:

Code:
=IF(A1<>0, A1, IF(B1<>0,B1,IF(C1<>0,C1,D1)))
 
Upvote 0
Another option which would save time and formula length if you add more columns:

=INDEX(A1:D1,MATCH(TRUE,INDEX(A1:D1<>0,),0))
 
Upvote 0
You don't need that second INDEX function.

=INDEX(A2:D2,MATCH(TRUE,A2:D2<>0,0))

Confirm with CTRL-SHIFT-ENTER rather than just Enter.
 
Last edited:
Upvote 0
Ah well, I found it that way and tested. Though it does save from having to CSE it. ;)
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,177
Members
453,021
Latest member
Justyna P

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