If = between range than * by this.

Ashman88

New Member
Joined
Oct 31, 2014
Messages
3
Hi,

I am trying to setup a spreadsheet for costings on weights.

Users will enter in weight in cell 1 on sheet 1 and cost will appear in cell 2 on sheet 1. But different weight ranges are equal to different value. I have create a separate sheet (2) for the weight prices as these need to be changed form time to time.

Example below

When users enters in value to cell 1 it needs to look up range in other sheet, check what the number is bewteen than multiply cell 1 by corresponding price and show result in cell 2.


Sheet 2 Example

abc
1StartFinishPrice
21300.5
3301500.4
4501800.2
5800 .1

<tbody>
</tbody>

Where 800 is in A5 this will be anything above 800


Thanks,
Ashman
 

Excel Facts

Lock one reference in a formula
Need 1 part of a formula to always point to the same range? use $ signs: $V$2:$Z$99 will always point to V2:Z99, even after copying
Try,

=LOOKUP(D2,Sheet1!A2:A5,Sheet1!C2:C5)

where D2 is the cell where user enters the value and sheet1 is the lookup sheet.

Sheet1!A2:A5 is the start
Sheet1!C2:C5 is the price

Note that A2 to A5 in lookup sheet should be in order.
 
Upvote 0
This will work with the example you gave (change sheet names to what you need). Also you had two instances for weight 800, following your logic I made the last entry in column A 801 rather than a second instance of 800.

=IF(AND(A2>=Sheet142!$A$2,A2<=Sheet142!$B$2),Sheet142!$C$2,IF(AND(A2>=Sheet142!$A$3,A2<=Sheet142!$B$3),Sheet142!$C$3,IF(AND(A2>=Sheet142!$A$4,A2<=Sheet142!$B$4),Sheet142!$C$4,Sheet142!$C$5)))

This assumes a separate column for the total weight * Price

If (as you stated) you wanted the calculated value in cell B2 on down use this:

=IF(AND(A11>=Sheet142!$A$2,A11<=Sheet142!$B$2),Sheet142!$C$2*A11,IF(AND(A11>=Sheet142!$A$3,A11<=Sheet142!$B$3),Sheet142!$C$3*A11,IF(AND(A11>=Sheet142!$A$4,A11<=Sheet142!$B$4),Sheet142!$C$4*A11,Sheet142!$C$5*A11)))
 
Last edited:
Upvote 0
Hi vds1,

This worked perfectly. I did have to modify to this =LOOKUP(G6,'Sheet1'!$D$4:$D$8,(G6*'sheet1'!$F$4:$F$8)

Is there anyway to put in a isblank or to have the cell2 show as 0 if cell 1 has no data. At the moment it shows #N/A. Later i will need to create rows of the formula above with a SUM at the bottom of cell 2
 
Upvote 0
Perhaps you can try IFERROR,

=IFERROR(LOOKUP(G6,'Sheet1'!$D$4:$D$8,(G6*'sheet1'!$F$4:$F$8),"")
 
Upvote 0

Forum statistics

Threads
1,214,782
Messages
6,121,532
Members
449,037
Latest member
tmmotairi

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