Row Summary: First, Last, Contiguous, Non-contiguous

tstout1000

New Member
Joined
Jan 26, 2022
Messages
11
Office Version
  1. 365
Platform
  1. Windows
I have a sheet showing forecasts by month.
1644349250589.png


For any particular row I want to be able to identify:
a) the column number or month of the first value >0; I can do this with MATCH(TRUE,(INDEX(U4:AF4>0,0)),0)
b) the column number or month of the last value >0; can't figure this one out
c) the number of months with a value (that's easy =COUNTIFS(U4:AF4,">0")
d) if there are any months where the values non-contiguous )i.e., goes to 0 after the first non 0 and the last non 0 number. Can't figure this one out.

Any ideas on b) and d)
Thanks,
Tim
 

Attachments

  • 1644348866173.png
    1644348866173.png
    11.1 KB · Views: 6

Excel Facts

Format cells as time
Select range and press Ctrl+Shift+2 to format cells as time. (Shift 2 is the @ sign).
b)
=IFERROR(LOOKUP(2,1/ISNUMBER(U4:AF4),COLUMN(U4:AF4)-COLUMN(U4)+1),0)

Didn't understand d)
Please, clarify
Try to provide some examples along with expected results

M.
 
Upvote 0

Forum statistics

Threads
1,215,219
Messages
6,123,688
Members
449,117
Latest member
Aaagu

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