How to auto populate values from diagonal cells in different columns

Tchme2

New Member
Joined
Mar 18, 2021
Messages
6
Office Version
  1. 365
Platform
  1. Windows
Hi, I want to enter numbers in Column H and have Column E auto populate with diagonal values like this ignoring blank cells.
 

Attachments

  • Diagonal Excel.jpg
    Diagonal Excel.jpg
    199.4 KB · Views: 59

Excel Facts

VLOOKUP to Left?
Use =VLOOKUP(A2,CHOOSE({1,2},$Z$1:$Z$99,$Y$1:$Y$99),2,False) to lookup Y values to left of Z values.
I think most people here would wonder, when they understand what you want, why not just type "=H5" in E9 and "=H9" in E12.
If you're looking for a way to automate even that, we'd need a systematic pattern of how the destination cell is decided.
 
Upvote 0
Thank you for getting back to me. I should have been more clear. Want E9 to get value from last non empty cell above H9. I need to enter for each day the vehicle is used and sometimes the vehicle is not used on a particular day which leaves some rows empty. I want those rows where the vehicle was not used to remain empty but I want the last previous mileage (Col H) to auto populate in the next day the vehicle is used (Col E).
 
Upvote 0
How about
Excel Formula:
=MAX(H3:H8)
 
Upvote 0
Want E9 to get value from last non empty cell above H9.
This can be achieved with the formula below in H9:
Excel Formula:
=LOOKUP(2,1/(H3:H8<>""),H3:H8)
But this isn't dynamic, unfortunately.
One solution I can think of is to prepare a column and rows for dates and a VBA code that populates the value in the last nonblank cell in column H to the row for a date that is matched with the date when you enter a new mileage.
 
Upvote 0
Thanks for answering. That just gives me the highest number in the column. I am looking for the last non blank cell in Col H above E9
 
Upvote 0
That just gives me the highest number in the column.
But surely the mileage will never go down (unless your illegally clocking your vehicles), so it will give the last value.
 
Upvote 0
Thanks Everyone for answering. I decided to work on a VBA code it's easier.
 
Upvote 0
But surely the mileage will never go down (unless your illegally clocking your vehicles), so it will give the last value.
Since it will be placed in Col E and copied down it just gives me the same highest number from Col H in the cells of Col E
 
Upvote 0
If you want to copy it down (which you never mentioned) then use
Excel Formula:
=MAX(H$3:H8)
and the range will expand as you drag it down col E
or use this mod to Kanadaaa's formula
Excel Formula:
        =LOOKUP(2,1/(H$3:H8<>""),H$3:H8)
 
Upvote 0

Forum statistics

Threads
1,214,608
Messages
6,120,500
Members
448,968
Latest member
screechyboy79

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