Creating multiple IFAND results in one help?!

tga86

New Member
Joined
Apr 14, 2023
Messages
5
Office Version
  1. 365
Platform
  1. Windows
Ok, I am self-teaching so bear with me if this is simple or even impossible or if i am confusing/overthinking things.
I have a table within a spreadsheet on Excel. An example of what I want to be able to do is;

In cell K23 i want the following to automatically calculate;
If the value in cell J22 is greater than cell b37 but less than cell b38 then I need to perform c38*j22-d38, or ifJ22 is greater than cell b38 but less than cell b39 I need to perform c39*j22-d39 or if j22 is greater than b39 but less than b40 I need to perform c40*j22-d40 and so on until row 45.

Is this possible? Have I made sense. I'm so sorry if not.
Thank you!
 

Excel Facts

Convert text numbers to real numbers
Select a column containing text numbers. Press Alt+D E F to quickly convert text to numbers. Faster than "Convert to Number"
Ok, I am self-teaching so bear with me if this is simple or even impossible or if i am confusing/overthinking things.
I have a table within a spreadsheet on Excel. An example of what I want to be able to do is;

In cell K23 i want the following to automatically calculate;
If the value in cell J22 is greater than cell b37 but less than cell b38 then I need to perform c38*j22-d38, or ifJ22 is greater than cell b38 but less than cell b39 I need to perform c39*j22-d39 or if j22 is greater than b39 but less than b40 I need to perform c40*j22-d40 and so on until row 45.

Is this possible? Have I made sense. I'm so sorry if not.
Thank you!
I made it a little simpler (for me lol) by already calculating the final (perform) steps and putting them in column F.
So now I need to
If the value in cell J22 is greater than cell b37 but less than cell b38 then I need to enter value in F38, or ifJ22 is greater than cell b38 but less than cell b39 I need to enter value in F39 or if j22 is greater than b39 but less than b40 I need to enter value in F40 and so on until row 45

Does this make it easier? Thank you :)
 
Upvote 0
Welcome to the Board!

It seems to me like you should be able to create a lookup table and use VLOOKUP with approximate matching to return what you want.
Something like this shown here: VLOOKUP calculate grades
 
Upvote 0
Solution
See if this works for you:
(you didn't say what you wanted to do in an = scenario)

20230414 Xlookup next larger tga86.xlsx
BCDEFIJKLMN
22Test Value >35Using Col F HelperWithout Helper
23Result >1399413994
24
35
36Col BCol CCol DCol F
371010093491
382020086992
3930300710493
4040400613994
4150500517495
4260600420996
4370700324497
4480800227998
4590900131499
46
Sheet1
Cell Formulas
RangeFormula
L23L23=XLOOKUP($J$22,$B$37:$B$45,$F$37:$F$45,"",1)
M23M23=XLOOKUP($J$22,$B$37:$B$45,$C$37:$C$45,"",1) * $J$22 - XLOOKUP($J$22,$B$37:$B$45,$D$37:$D$45,"",1)
F37:F45F37=C37*$J$22-D37
 
Upvote 0
Welcome to the Board!

It seems to me like you should be able to create a lookup table and use VLOOKUP with approximate matching to return what you want.
Something like this shown here: VLOOKUP calculate grades
Thank you so much, I hadn't even discovered vlookup and it's functions yet and it is exactly what I needed :). I needed to tweak and shift my results columns up 1 row but that works for me. Thank you so much!
 
Upvote 0
You are welcome.
Glad we were able to help!
 
Upvote 0
Thank you so much, I hadn't even discovered vlookup and it's functions yet and it is exactly what I needed :). I needed to tweak and shift my results columns up 1 row but that works for me. Thank you so much!
The newer Xlookup is more flexible than vlookup. If you use the XLookup formula I provided you should not need to "shift your results columns up 1 row".
While VLookup will look up the previous item, the 1 parameter at the end of my XLookup tells it to look at the next larger item.
 
Upvote 0
Thank you so much, I hadn't even discovered vlookup and it's functions yet and it is exactly what I needed :). I needed to tweak and shift my results columns up 1 row but that works for me. Thank you so much!
Actually using the first formula in the L23 column seems to be working perfectly :) without needing to shift that final column! Thank you, have a great day/evening.
 
Upvote 0
The newer Xlookup is more flexible than vlookup. If you use the XLookup formula I provided you should not need to "shift your results columns up 1 row".
While VLookup will look up the previous item, the 1 parameter at the end of my XLookup tells it to look at the next larger item.
Lol, sorry page hadn't reloaded with your reply. I've just seen your message and that explains perfectly why that works and the other didn't. Thanks :)
 
Upvote 0

Forum statistics

Threads
1,215,261
Messages
6,123,933
Members
449,134
Latest member
NickWBA

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