index return last value horizontally

King_Louie

New Member
Joined
Dec 7, 2019
Messages
13
Office Version
  1. 2016
Platform
  1. Windows
Hi,

I have a s/s that tracks the status of a product as it moves along the manufacturing process. I'm trying to find an array formula that retrieves data from the last column containing data so I can see the current status of that product. Any ideas?

Thanks
 

Attachments

  • Example.gif
    Example.gif
    9 KB · Views: 16

Excel Facts

Fastest way to copy a worksheet?
Hold down the Ctrl key while dragging tab for Sheet1 to the right. Excel will make a copy of the worksheet.
If you know the row number corresponding to the product (e.g. row 2) and the last data is always text:

=IFERROR(LOOKUP("zzzz",B2:Z2), "")

Enter enough z's so that the string is larger than any possible text data. I suspect that even two z's is sufficient.

If the last data might be numeric or text, you might consider the following:

=IFERROR(INDEX(B2:Z2, MAX(IFERROR(MATCH("zzzz",B2:Z2),0), IFERROR(MATCH(1E+300,B2:Z2),0))), "")

1E+300 is probably larger than any possible actual numeric data. Even though it is not the largest possible numeric value, it is easy to remember. (So is 1E+100, which is also probably large enough.)

-----

Some people needlessly write 9.99999999999999E+307. That is the largest numeric value that we can enter manually. But it, too, is not the largest possible numeric value that might be calculated.

The largest possible numeric value is 1.7976931348623157E+308, which we can enter accurately in VBA. In Excel, we can enter =10*1.79769313486231E+307 + 5.79E+293.

Both are just a little silly, IMHO.
 
Upvote 0
The formula is slightly working. I need to include an offset(?) function into the formula because it's always pulling the data in the last cell but I need data from before it. For example, the s/s has the following columns: "Status #1 Area", "Status #1 Date" , "Status #2 Area", "Status #2 Date" , etc., and then in the last two columns "Current Status Date" & "Current Status Area". With the above formula, it's always inserting the last known Area data.

+++++++++++++++++++++++++++++++
Are there any other formulas that can be used without using placeholder variables ("zzz")?

Such as, look in columns C,E,G and return the last cell with data in it?
=IFERROR(INDEX({C,E,G}, MAX(IFERROR(MATCH({C,E,G}),0), IFERROR(MATCH({C,E,G}),0))), "")
 

Attachments

  • Example.gif
    Example.gif
    18.7 KB · Views: 5
Upvote 0
This gives you the cell directly left of the last fill:

Book1
DEFGHIJKLMNOPQRSTUVW
3HAA1LLG1JBB1EGB1SCI1UVF1AYT1JPQ1NKO1HIY1CYS1KHR1GGE1MMQ1BYL1GAU1FLT1AWI1FLT1
4GNQ1CVL1JMM1PQC1WCY1ASE1GCU1IFO1AQS1QRQ1UUB1MIX1FW1HOV1BXU1VG1BTZ1DQD1MEC1DQD1
5FRD1SZJ1EGW1GL1RDO1CYJ1BDH1FAP1TMG1ODN1QCO1DIW1JNR1MAG1EUD1QXK1FUM1QXK1
6MQN1KTA1QSL1DAV1VOP1BUA1UZ1KSV1NAU1TYU1AJN1LDU1CDJ1LOK1LZ1PZQ1BQO1EXZ1UP1EXZ1
7RGN1HS1OCU1FRM1LZR1PIE1RDU1FPT1EBF1QCO1DZH1DAJ1CDY1CFZ1BNW1LXU1FLC1OGO1FLH1OGO1
8EDB1BQR1HRX1MHJ1PI1NLA1GSG1OZP1DZX1HCT1GM1JVE1OWA1JVE1
9INY1HTT1RYB1EGP1WAS1MJL1VXX1MOP1JAF1MPL1KCI1FNM1AWV1PHD1NFT1UHK1UXO1QAD1CEU1QAD1
10VEH1RMR1GX1UTR1SK1FQM1TUL1MOG1GXF1FUG1BPZ1KQK1UYK1QZU1OTS1IWB1WNB1BP1WJI1BP1
11HRH1KAL1OAO1JXC1LQN1NBC1TYI1NBC1
Sheet1
Cell Formulas
RangeFormula
W3W3=LOOKUP(2,1/($D3:$V3<>""),$C3:$U3)
 
Upvote 0
Thanks for the help so far but still not working correctly. Looking to populate the "Current Status Date" & Current Status Area" columns with the last known status updates for each row. For example for Car # AA, is currently at QC (Quality Control) as of the 10/25/19 and BB22 is at Paint as of 10/15/19. These last known statuses (Area & Date) should be populated in "Current Status Date" & Current Status Area" .

Car #​
Status #1 DateStatus # 1 AreaStatus #2 DateStatus # 2 AreaStatus #3 DateStatus # 3 AreaCurrent Status DateCurrent Status Area
AA11​
10/1/2019​
assembly
10/15/2019​
paint
10/25/2019​
QC10/25/2019QC
BB22​
10/1/2019​
assembly
10/15/2019​
paint10/15/2019paint
CC33​
10/1/2019​
assembly10/1/2019assembly
 
Upvote 0
This?

Book1
ABCDEFGHI
1Car #Status #1 DateStatus # 1 AreaStatus #2 DateStatus # 2 AreaStatus #3 DateStatus # 3 AreaCurrent Status DateCurrent Status Area
2AA1110/1/2019assembly10/15/2019paint10/25/2019QC10/25/2019QC
3BB2210/1/2019assembly10/15/2019paint10/15/2019paint
4CC3310/1/2019assembly10/1/2019assembly
Sheet2
Cell Formulas
RangeFormula
H2H2=LOOKUP(2,1/($B2:$G2<>""),$A2:$F2)
I2I2=LOOKUP(2,1/($B2:$G2<>""),$B2:$G2)
 
Upvote 0
The formula is slightly working. [....] it's always pulling the data in the last cell but I need data from before it.

Well, you did write initially: ``from the last column containing data so I can see the current status``. Now you are saying that you want the current status date?

How about:

=IFERROR(INDEX(B2:Z2, MATCH("zzzz",B2:Z2)-1), "")
or
=IFERROR(INDEX(B2:Z2, MAX(IFERROR(MATCH("zzzz",B2:Z2)-1,0), IFERROR(MATCH(1E+300,B2:Z2)-1,0))), "")

formatted as Date or some date variant.

I see nothing wrong with using "zzzz" or 1E+300. "That's how it's done". But CHAR(255) probably works instead of "zzzz". "The test is left as an exercise for the student".

I also see no reason to use the second formula if "status area" is always text. Even if it looks numeric, it would be prudent to enter it as text (or format the column as Text beforehand), IMHO. KISS.

Clarification: The search type ("zzzz") depends on the type of the last column, not the column that you are selecting (numeric date). You do not need the second formula just because the result of the formula is numeric (date).
 
Upvote 0
Ran into issue to an unforeseen issue. The above example did not consider blank cells in a current status grouping. For example, please see revised table below. The most recent status for Car #AA11 is in Status # 3. The suggested formulas above (based on my initial request) would start at Status #3 Area because that is the first cell with data/text--throwing off returned data/text. In my actual spreadsheet, there are numerous fields within each status group that may be blank.

The Date section in each status group (1,2,&3) will be a mandatory entry field. What formula would be best to look in the Columns B,E,&H to find the most recent entry and then input data based on specified offset (+1,+2,+3)?

ABCDEFGHIJKLM
Car #Status #1 DateStatus # 1 AreaStatus # 1 CommentStatus #2 DateStatus # 2 AreaStatus # 2 CommentStatus #3 DateStatus # 3 AreaStatus # 3 CommentCurrent Status DateCurrent Status AreaCurrent Status Comment
AA1110/1/2019assembly10/15/2019paintblue10/25/2019QC10/25/2019QC
BB2210/1/2019assemblybroken light10/15/2019paintred10/15/2019paintred
CC3310/1/2019assembly10/1/2019assembly
 
Upvote 0
if you are after the last numeric value, just invoke:

=LOOKUP(9.99999999999999E+307,Reference)

where reference is a whole column or a whole row.
 
Upvote 0
if you are after the last numeric value, just invoke:

=LOOKUP(9.99999999999999E+307,Reference)

where reference is a whole column or a whole row.

I want to return all data/text from the recent section group. For example, in the current grouping columns (K,L,&M) for Car #AA11, the formulas should return "10/25/2019", "QC", & "(Blank)".
 
Upvote 0

Forum statistics

Threads
1,215,219
Messages
6,123,683
Members
449,116
Latest member
HypnoFant

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