Return column ref based on last positive value

SimonHughes

Active Member
Joined
Sep 16, 2009
Messages
452
Office Version
  1. 365
Platform
  1. Windows
A
B
C
D
E
Last Invoice Column
32
0
0
45
0
D
12
21
0
0
0
B
0
0
45
32
0
D

<tbody>
</tbody>

Hello, I want to return the column reference when that column contains value greater than £0 so I can see when last a customer was invoiced. Can anyone suggest a formula to do this?
 

Excel Facts

Select a hidden cell
Somehide hide payroll data in column G? Press F5. Type G1. Enter. Look in formula bar while you arrow down through G.
Hello, firstly, thanks for the help. I have changed the formula to suit the actual range but strangely, it is returning column A in many cases and column A is outside of the data selected. Any ideas on why this could be happening? =MID(ADDRESS(1,MAX(IF(D2:AE2>0,COLUMN(D2:AE2)))),2,1)
 
Upvote 0
Simon,

If you have the column letters in row 1 ??

Then maybe....

Excel 2007
ABCDEFG
1ABCDEFLast Invoice Column
23200450D
31221000B
40045320D
Sheet4
Cell Formulas
RangeFormula
G2{=IFERROR(INDEX($A$1:$E$1,1,(LOOKUP(10^10,IF(A2:E2>0,COLUMN(A2:E2),"")))),"")}
Press CTRL+SHIFT+ENTER to enter array formulas.
Hope that helps.
 
Last edited:
Upvote 0
Or, if you only have the few columns, maybe...

Excel 2007
ABCDEFG
1Last Invoice Column
23200450D
31221000B
40045320D
Sheet4
Cell Formulas
RangeFormula
G2{=IFERROR(CHOOSE((LOOKUP(10^10,IF(A2:E2>0,COLUMN(A2:E2),""))),"A","B","C","D","E","F"),"")}
Press CTRL+SHIFT+ENTER to enter array formulas.
 
Upvote 0

Forum statistics

Threads
1,214,415
Messages
6,119,375
Members
448,888
Latest member
Arle8907

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