Formula Q: Should be simple but got me stuck

franklin_m

New Member
Joined
Jun 16, 2013
Messages
47
Office Version
  1. 365
Platform
  1. Windows
  2. MacOS
I have a set of data, a subset provided in the mini sheet, that I want to do a calculation for the area in gray/red using a formula that I can drag across columns and rows to match the full data set. Cells E1:P1 and D2:D13 are years. Cells A2:A13 are years. Cells B2:B13 are datapoints corresponding to a value in that year.

Here's what it's doing - albeit a brute force method: For the value in F6, it takes B3 and divides by B6 (=$B$3/$B6). Similarly, for the value in N4, it takes B11 divided by B4 (=$B$11/$B4). Note that I colored cells in red where it's dividing a number by itself - which also makes for a convenient error check.

What I would like is a formula for the gray area that I can drag and fill for a period of years from 2024 back to 1914 instead of brute force.

Thanks.
 

Attachments

  • Calculation Needed.png
    Calculation Needed.png
    43.6 KB · Views: 7

Excel Facts

Back into an answer in Excel
Use Data, What-If Analysis, Goal Seek to find the correct input cell value to reach a desired result
What version of Excel are you using?

I suggest that you update your Account details (or click your user name at the top right of the forum) so helpers always know what Excel version(s) & platform(s) you are using as the best solution often varies by version. (Don’t forget to scroll down & ‘Save’)
 
Upvote 0
In E2:
Excel Formula:
=XLOOKUP(E$1,$A:$A,$B:$B)/$B2
For older versions that do not have XLOOKUP:
Excel Formula:
=VLOOKUP(E$1,$A:$B,2)/$B2
Copy to fill table.

In later versions it might be possible to do this with a single array formula in E2 but I'm not sure.

Since you provided a picture instead of actual data I did not set up a sheet from scratch to test this.
 
Upvote 0
Solution
What version of Excel are you using?

I suggest that you update your Account details (or click your user name at the top right of the forum) so helpers always know what Excel version(s) & platform(s) you are using as the best solution often varies by version. (Don’t forget to scroll down & ‘Save’)
Done ... Microsoft® Excel® for Microsoft 365 MSO (Version 2408 Build 16.0.17928.20114) 64-bit
 
Upvote 0
In E2:
Excel Formula:
=XLOOKUP(E$1,$A:$A,$B:$B)/$B2
For older versions that do not have XLOOKUP:
Excel Formula:
=VLOOKUP(E$1,$A:$B,2)/$B2
Copy to fill table.

In later versions it might be possible to do this with a single array formula in E2 but I'm not sure.

Since you provided a picture instead of actual data I did not set up a sheet from scratch to test this.
Jeff, that's perfect ... it works! I figured it'd be something simple. My experience with Xlookup is thin, seeing how it solves problems like this makes it much more valuable!
 
Upvote 0
Thanks for updating your profile. (y)
Another option in E2 only is
Excel Formula:
=TOROW(B2:B13)/B2:B13
 
Upvote 1
Thanks for updating your profile. (y)
Another option in E2 only is
Excel Formula:
=TOROW(B2:B13)/B2:B13
Thanks ... btw, I went looking for thread tool to mark this is answered etc., can't seem to find it. Did I miss it?
 
Upvote 0
Glad we could help & thanks for the feedback.

We don't mark threads as answered, but you can select the tick mark to the right of one post to mark it as the solution.
 
Upvote 0

Forum statistics

Threads
1,221,700
Messages
6,161,378
Members
451,700
Latest member
Eccymarge

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