Hello, I'm having trouble with this and I'm hoping somebody here may be able to help.
Here is a sample of my data:
[TABLE="class: outer_border, width: 500, align: left"]
<tbody>[TR]
[TD][/TD]
[TD]2011
[/TD]
[TD]2011
[/TD]
[TD]2011
[/TD]
[TD]2011
[/TD]
[TD]2012
[/TD]
[TD]2012
[/TD]
[TD]2012
[/TD]
[TD]2012
[/TD]
[TD]2013
[/TD]
[TD]2013
[/TD]
[TD]2013
[/TD]
[TD]2013
[/TD]
[TD]2014
[/TD]
[TD]2014
[/TD]
[TD]2014
[/TD]
[TD]2014
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD]
[TABLE="width: 37"]
<tbody>[TR]
[TD]Co.1
[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD]
[TABLE="width: 37"]
<tbody>[TR]
[TD]Co.1
[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD]
[TABLE="width: 37"]
<tbody>[TR]
[TD]Co.2
[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD]
[TABLE="width: 37"]
<tbody>[TR]
[TD]Co.2
[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD]
[TABLE="width: 37"]
<tbody>[TR]
[TD]Co.1
[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD]
[TABLE="width: 37"]
<tbody>[TR]
[TD]Co.1
[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD]
[TABLE="width: 37"]
<tbody>[TR]
[TD]Co.2
[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD]
[TABLE="width: 37"]
<tbody>[TR]
[TD]Co.2
[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD]
[TABLE="width: 37"]
<tbody>[TR]
[TD]Co.1
[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD]
[TABLE="width: 37"]
<tbody>[TR]
[TD]Co.1
[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD]
[TABLE="width: 37"]
<tbody>[TR]
[TD]Co.2
[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD]
[TABLE="width: 37"]
<tbody>[TR]
[TD]Co.2
[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD]
[TABLE="width: 37"]
<tbody>[TR]
[TD]Co.1
[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD]
[TABLE="width: 37"]
<tbody>[TR]
[TD]Co.1
[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD]
[TABLE="width: 37"]
<tbody>[TR]
[TD]Co.2
[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD]
[TABLE="width: 37"]
<tbody>[TR]
[TD]Co.2
[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Acct Name
[/TD]
[TD]DIESEL
[/TD]
[TD]PROPANE
[/TD]
[TD]DIESEL
[/TD]
[TD]PROPANE
[/TD]
[TD]DIESEL
[/TD]
[TD]PROPANE
[/TD]
[TD]DIESEL
[/TD]
[TD]PROPANE
[/TD]
[TD]DIESEL
[/TD]
[TD]PROPANE
[/TD]
[TD]DIESEL
[/TD]
[TD]PROPANE
[/TD]
[TD]DIESEL
[/TD]
[TD]PROPANE
[/TD]
[TD]DIESEL
[/TD]
[TD]PROPANE
[/TD]
[TD]Year of last propane Purchase
[/TD]
[TD]Lost?
[/TD]
[TD]Year Lost
[/TD]
[/TR]
[TR]
[TD]GR
[/TD]
[TD]-
[/TD]
[TD]-
[/TD]
[TD]-
[/TD]
[TD]-
[/TD]
[TD]-
[/TD]
[TD]-
[/TD]
[TD]-
[/TD]
[TD]-
[/TD]
[TD]-
[/TD]
[TD]3
[/TD]
[TD]-
[/TD]
[TD]-
[/TD]
[TD]-
[/TD]
[TD]-
[/TD]
[TD]-
[/TD]
[TD]-
[/TD]
[TD]2013
[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]MO
[/TD]
[TD]-
[/TD]
[TD]-
[/TD]
[TD]29
[/TD]
[TD]-
[/TD]
[TD]-
[/TD]
[TD]-
[/TD]
[TD]128
[/TD]
[TD]-
[/TD]
[TD]55
[/TD]
[TD]30
[/TD]
[TD]-
[/TD]
[TD]-
[/TD]
[TD]-
[/TD]
[TD]-
[/TD]
[TD]15
[/TD]
[TD]-
[/TD]
[TD]2013
[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]CH
[/TD]
[TD]-
[/TD]
[TD]-
[/TD]
[TD]-
[/TD]
[TD]-
[/TD]
[TD]-
[/TD]
[TD]-
[/TD]
[TD]-
[/TD]
[TD]-
[/TD]
[TD]-
[/TD]
[TD]-
[/TD]
[TD]-
[/TD]
[TD]-
[/TD]
[TD]-
[/TD]
[TD]3
[/TD]
[TD]-
[/TD]
[TD]-
[/TD]
[TD]2014
[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]TI
[/TD]
[TD]-
[/TD]
[TD]-
[/TD]
[TD]16
[/TD]
[TD]-
[/TD]
[TD]-
[/TD]
[TD]5
[/TD]
[TD]7
[/TD]
[TD]-
[/TD]
[TD]-
[/TD]
[TD]-
[/TD]
[TD]11
[/TD]
[TD]-
[/TD]
[TD]11
[/TD]
[TD]-
[/TD]
[TD]-
[/TD]
[TD]-
[/TD]
[TD]2012
[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
I want a formula that will be able to check the year of last propane purchase and then search to see if there was a diesel purchase any year after that and return the year in one column and the company name in another.
My first attempt was this: =IF(LOOKUP(2,1/(B5:Q5),$B$3:$Q$3)="PROPANE","",LOOKUP(2,1/(B5:Q5),$B$1:$Q$1))
It searched the last purchase made by the customer and returns blank if propane and returns the year if it is diesel. The problem with this is that this does not actually show the year of the Loss (or switch) such as the case with the TI account. Their last purchase was in 2012 and the formula returns 2014 for the last diesel purchase, however they actually switched back to diesel in 2013 when they bought those 11 units from Co.2.
I have one column with a formula that shows the "Year of last propane purchase". I was thinking this may be able to help in creating some type of formula to search any year after that, but I can't figure it out.
Any help is greatly appreciated! And if I can clarify or explain anything further please let me know.
- Byanka
NOTE: The "-" in the data are zero values.
Here is a sample of my data:
[TABLE="class: outer_border, width: 500, align: left"]
<tbody>[TR]
[TD][/TD]
[TD]2011
[/TD]
[TD]2011
[/TD]
[TD]2011
[/TD]
[TD]2011
[/TD]
[TD]2012
[/TD]
[TD]2012
[/TD]
[TD]2012
[/TD]
[TD]2012
[/TD]
[TD]2013
[/TD]
[TD]2013
[/TD]
[TD]2013
[/TD]
[TD]2013
[/TD]
[TD]2014
[/TD]
[TD]2014
[/TD]
[TD]2014
[/TD]
[TD]2014
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD]
[TABLE="width: 37"]
<tbody>[TR]
[TD]Co.1
[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD]
[TABLE="width: 37"]
<tbody>[TR]
[TD]Co.1
[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD]
[TABLE="width: 37"]
<tbody>[TR]
[TD]Co.2
[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD]
[TABLE="width: 37"]
<tbody>[TR]
[TD]Co.2
[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD]
[TABLE="width: 37"]
<tbody>[TR]
[TD]Co.1
[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD]
[TABLE="width: 37"]
<tbody>[TR]
[TD]Co.1
[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD]
[TABLE="width: 37"]
<tbody>[TR]
[TD]Co.2
[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD]
[TABLE="width: 37"]
<tbody>[TR]
[TD]Co.2
[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD]
[TABLE="width: 37"]
<tbody>[TR]
[TD]Co.1
[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD]
[TABLE="width: 37"]
<tbody>[TR]
[TD]Co.1
[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD]
[TABLE="width: 37"]
<tbody>[TR]
[TD]Co.2
[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD]
[TABLE="width: 37"]
<tbody>[TR]
[TD]Co.2
[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD]
[TABLE="width: 37"]
<tbody>[TR]
[TD]Co.1
[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD]
[TABLE="width: 37"]
<tbody>[TR]
[TD]Co.1
[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD]
[TABLE="width: 37"]
<tbody>[TR]
[TD]Co.2
[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD]
[TABLE="width: 37"]
<tbody>[TR]
[TD]Co.2
[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Acct Name
[/TD]
[TD]DIESEL
[/TD]
[TD]PROPANE
[/TD]
[TD]DIESEL
[/TD]
[TD]PROPANE
[/TD]
[TD]DIESEL
[/TD]
[TD]PROPANE
[/TD]
[TD]DIESEL
[/TD]
[TD]PROPANE
[/TD]
[TD]DIESEL
[/TD]
[TD]PROPANE
[/TD]
[TD]DIESEL
[/TD]
[TD]PROPANE
[/TD]
[TD]DIESEL
[/TD]
[TD]PROPANE
[/TD]
[TD]DIESEL
[/TD]
[TD]PROPANE
[/TD]
[TD]Year of last propane Purchase
[/TD]
[TD]Lost?
[/TD]
[TD]Year Lost
[/TD]
[/TR]
[TR]
[TD]GR
[/TD]
[TD]-
[/TD]
[TD]-
[/TD]
[TD]-
[/TD]
[TD]-
[/TD]
[TD]-
[/TD]
[TD]-
[/TD]
[TD]-
[/TD]
[TD]-
[/TD]
[TD]-
[/TD]
[TD]3
[/TD]
[TD]-
[/TD]
[TD]-
[/TD]
[TD]-
[/TD]
[TD]-
[/TD]
[TD]-
[/TD]
[TD]-
[/TD]
[TD]2013
[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]MO
[/TD]
[TD]-
[/TD]
[TD]-
[/TD]
[TD]29
[/TD]
[TD]-
[/TD]
[TD]-
[/TD]
[TD]-
[/TD]
[TD]128
[/TD]
[TD]-
[/TD]
[TD]55
[/TD]
[TD]30
[/TD]
[TD]-
[/TD]
[TD]-
[/TD]
[TD]-
[/TD]
[TD]-
[/TD]
[TD]15
[/TD]
[TD]-
[/TD]
[TD]2013
[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]CH
[/TD]
[TD]-
[/TD]
[TD]-
[/TD]
[TD]-
[/TD]
[TD]-
[/TD]
[TD]-
[/TD]
[TD]-
[/TD]
[TD]-
[/TD]
[TD]-
[/TD]
[TD]-
[/TD]
[TD]-
[/TD]
[TD]-
[/TD]
[TD]-
[/TD]
[TD]-
[/TD]
[TD]3
[/TD]
[TD]-
[/TD]
[TD]-
[/TD]
[TD]2014
[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]TI
[/TD]
[TD]-
[/TD]
[TD]-
[/TD]
[TD]16
[/TD]
[TD]-
[/TD]
[TD]-
[/TD]
[TD]5
[/TD]
[TD]7
[/TD]
[TD]-
[/TD]
[TD]-
[/TD]
[TD]-
[/TD]
[TD]11
[/TD]
[TD]-
[/TD]
[TD]11
[/TD]
[TD]-
[/TD]
[TD]-
[/TD]
[TD]-
[/TD]
[TD]2012
[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
I want a formula that will be able to check the year of last propane purchase and then search to see if there was a diesel purchase any year after that and return the year in one column and the company name in another.
My first attempt was this: =IF(LOOKUP(2,1/(B5:Q5),$B$3:$Q$3)="PROPANE","",LOOKUP(2,1/(B5:Q5),$B$1:$Q$1))
It searched the last purchase made by the customer and returns blank if propane and returns the year if it is diesel. The problem with this is that this does not actually show the year of the Loss (or switch) such as the case with the TI account. Their last purchase was in 2012 and the formula returns 2014 for the last diesel purchase, however they actually switched back to diesel in 2013 when they bought those 11 units from Co.2.
I have one column with a formula that shows the "Year of last propane purchase". I was thinking this may be able to help in creating some type of formula to search any year after that, but I can't figure it out.
Any help is greatly appreciated! And if I can clarify or explain anything further please let me know.
- Byanka
NOTE: The "-" in the data are zero values.