query referring to an if / then, followed by subtraction.

alreed96

New Member
Joined
Oct 15, 2024
Messages
4
Office Version
  1. 2013
Platform
  1. Windows
okay, I created a spreadsheet that has a group of numbers from 1-50...what i am trying to do is find out when a particular value has shown up and subtract it from the value that is in another cell. the set up is as follows:

B2 = value

E54:E194 = array of values where [value] can be found

L54:L194 = number of day since [value] was last used

i want to know what formula would work by taking above information and being able to find [value] in array of values then subtracting [value] from day since [value] was last used. Note: the [value] that I'm looking for would be in the same row as the [value] i want to subtract it from, only in a different column. What I eventually want to do is copy and paste said formula down the list of values, so that each value has a another value next to it stating when that value was last used.
 

Excel Facts

Control Word Wrap
Press Alt+Enter to move to a new row in a cell. Lets you control where the words wrap.
Hi & welcome to MrExcel.
How about
Excel Formula:
=B2-INDEX($L$54:$L$194,MATCH(B2,$E$54:$E$194,0))
 
Upvote 0
Solution
=B2-INDEX($L$54:$L$194,MATCH(B2,$E$54:$E$194,0))
well, it seems that my B2 value is off by a couple of cells., but it did do the trick, i just need to figure out why my value doesn't match with the array and subtraction values.
 
Upvote 0
You're welcome & thanks for the feedback.
 
Upvote 0
okay, finally figured where the problem was, putting the ='B2-' at the start of the formula, wasn't needed. Once I removed that from the formula, everything else went smoothly, thank you so much for the assistance. You guys are tops.
 
Upvote 0
No, we don't close threads here.
 
Upvote 0

Forum statistics

Threads
1,225,362
Messages
6,184,514
Members
453,237
Latest member
lordleo

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