Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

# Of Years Calculation

Posted on 2016-08-30
8
Medium Priority
?
72 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 2
8 Comments
 
LVL 33

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 33

Accepted Solution

by:
Subodh Tiwari (Neeraj) earned 2000 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 33

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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 33

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 33

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 33

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 33

Expert Comment

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

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

This article descibes how to create a connection between Excel and SAP and how to move data from Excel to SAP or the other way around.
You need to know the location of the Office templates folder, so that when you create new templates, they are saved to that location, and thus are available for selection when creating new documents.  The steps to find the Templates folder path are …
This Micro Tutorial demonstrates in Microsoft Excel how to consolidate your marketing data by creating an interactive charts using form controls. This creates cool drop-downs for viewers of your chart to choose from.
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

636 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