Solved

# Of Years Calculation

Posted on 2016-08-30
8
55 Views
Last Modified: 2016-08-30
Hi there,

I am attempting to calculate consecutive years in the attached file - for each year of activity the value is "1" if no activity the value is 0.

From Right to left (2015 to 1987) if there is a value of 1 then continue to move to the next column to the left.  If the value is 0 then return the column header year and discontinue any calculations.

Attached is the file layout - let me know if there are any questions on what I am asking.  I usually do this in crystal reports but am hoping to get away from the labour-intensive setup.

Thanks very much - CS
EE-Sample.xlsx
0
Comment
Question by:rporter45
  • 5
  • 2
8 Comments
 
LVL 29

Expert Comment

by:Subodh Tiwari (Neeraj)
ID: 41776345
Are you trying to calculate col. AG?
If so, you may use the following formula to get the desired output in col. AG...
=COUNTIF(B2:AD2,1)

Open in new window

and copy down.
0
 
LVL 29

Accepted Solution

by:
Subodh Tiwari (Neeraj) earned 500 total points
ID: 41776372
If you are trying to return the header year from the right where it encounters the first zero, you may try this.....

On Row2 of a blank column
=INDEX($B$1:$AD$1,MAX(INDEX((B2:AD2=0)*(COLUMN($B$1:$AD$1)-COLUMN($B$1)+1),)))

Open in new window


And if you are interested in header year where the last consecutive 1 is found from the right, try this...
=INDEX($B$1:$AD$1,MAX(INDEX((B2:AD2=0)*(COLUMN($B$1:$AD$1)-COLUMN($B$1)+1),))+1)

Open in new window

0
 
LVL 32

Expert Comment

by:Rob Henson
ID: 41776384
The way I read your question is that you are trying to find the most recent year of inactivity.

ID      Year
100   1997
200   1996
300   1996
etc

Is that correct? Not sure how you would do it with current layout.

Thanks
Rob
0
Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

 
LVL 29

Expert Comment

by:Subodh Tiwari (Neeraj)
ID: 41776396
@Rob
That is what the first of the two formulas from my previous post does. :)
0
 
LVL 32

Expert Comment

by:Rob Henson
ID: 41776436
@Neeraj - I hadn't refreshed while entering my comment so didn't see your post. I was posting to confirm interpretation of the question. If our interpretation is correct then hopefully your solution will be what is required.

Thanks
Rob
0
 
LVL 29

Expert Comment

by:Subodh Tiwari (Neeraj)
ID: 41776517
No Problem Rob!
Actually your post confirmed that I was thinking in the right direction. :)
Now it's up to OP to confirm whether this was the original request.
0
 

Author Closing Comment

by:rporter45
ID: 41776524
This worked perfectly! Saves me a ton of time - very much appreciated,

Have a great day,
Colleen
0
 
LVL 29

Expert Comment

by:Subodh Tiwari (Neeraj)
ID: 41777063
You're welcome. Glad to help.
0

Featured Post

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Introduction This Article is a follow-up to my Mappit! Addin Article (http://www.experts-exchange.com/A_2613.html), it was inspired by an email posting I made to EUSPRIG (http://www.eusprig.org/index.htm), I will briefly cover: 1) An overvie…
This article will guide you to convert a grid from a picture into Excel format using Microsoft OneNote and no other 3rd party application.
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
Many functions in Excel can make decisions. The most simple of these is the IF function: it returns a value depending on whether a condition you describe is true or false. Once you get the hang of using the IF function, you will find it easier to us…

813 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now