Conditional Vlookup

arlene_fool

Board Regular
Joined
Feb 17, 2007
Messages
55
I am trying to create a report driven by a large table, for easy reporting to my salesmen.
Below is a section of the large table, and then the section of the report i am having troubles with, on the table i was abe to create conditions so it would show if the shortages listed were a neg number it would just format the color not to show. how do i do a vlookup, where if the number returned is a negative number it just puts in 0?
Excel Workbook
AJKLMNO
4#21'20'19'18'17'16'
2622-951-3616170
2723-9540-3612607
Shortages
Excel 2010
Cell Formulas
RangeFormula
A4='Orders Sheet'!A4
A26='Orders Sheet'!A26
A27='Orders Sheet'!A27
J4='Orders Sheet'!J4
J26=IF((SUM('Orders Sheet'!J$5:J26))-J$51>'Orders Sheet'!J26,'Orders Sheet'!J26,(SUM('Orders Sheet'!J$5:J26))-J$51)
J27=IF((SUM('Orders Sheet'!J$5:J27))-J$51>'Orders Sheet'!J27,'Orders Sheet'!J27,(SUM('Orders Sheet'!J$5:J27))-J$51)
K4='Orders Sheet'!K4
K26=IF((SUM('Orders Sheet'!K$5:K26))-K$51>'Orders Sheet'!K26,'Orders Sheet'!K26,(SUM('Orders Sheet'!K$5:K26))-K$51)
K27=IF((SUM('Orders Sheet'!K$5:K27))-K$51>'Orders Sheet'!K27,'Orders Sheet'!K27,(SUM('Orders Sheet'!K$5:K27))-K$51)
L4='Orders Sheet'!L4
L26=IF((SUM('Orders Sheet'!L$5:L26))-L$51>'Orders Sheet'!L26,'Orders Sheet'!L26,(SUM('Orders Sheet'!L$5:L26))-L$51)
L27=IF((SUM('Orders Sheet'!L$5:L27))-L$51>'Orders Sheet'!L27,'Orders Sheet'!L27,(SUM('Orders Sheet'!L$5:L27))-L$51)
M4='Orders Sheet'!M4
M26=IF((SUM('Orders Sheet'!M$5:M26))-M$51>'Orders Sheet'!M26,'Orders Sheet'!M26,(SUM('Orders Sheet'!M$5:M26))-M$51)
M27=IF((SUM('Orders Sheet'!M$5:M27))-M$51>'Orders Sheet'!M27,'Orders Sheet'!M27,(SUM('Orders Sheet'!M$5:M27))-M$51)
N4='Orders Sheet'!N4
N26=IF((SUM('Orders Sheet'!N$5:N26))-N$51>'Orders Sheet'!N26,'Orders Sheet'!N26,(SUM('Orders Sheet'!N$5:N26))-N$51)
N27=IF((SUM('Orders Sheet'!N$5:N27))-N$51>'Orders Sheet'!N27,'Orders Sheet'!N27,(SUM('Orders Sheet'!N$5:N27))-N$51)
O4='Orders Sheet'!O4
O26=IF((SUM('Orders Sheet'!O$5:O26))-O$51>'Orders Sheet'!O26,'Orders Sheet'!O26,(SUM('Orders Sheet'!O$5:O26))-O$51)
O27=IF((SUM('Orders Sheet'!O$5:O27))-O$51>'Orders Sheet'!O27,'Orders Sheet'!O27,(SUM('Orders Sheet'!O$5:O27))-O$51)
Excel Workbook
ABCDEFGHIJ
1Line #22
12OrderedAvailableShortOrderedAvailableShort
13Aluma Beam 6-1/2"Aluma Frames
141094' Beam8-99-107245Aluma Frame 6x80
151115' Beam4696-692215Aluma Frame 6x60
Report
Excel 2010
Cell Formulas
RangeFormula
C14=VLOOKUP(Report!$B$1,'Orders Sheet'!$A$5:$BZ$49,28,FALSE)
C15=VLOOKUP(Report!$B$1,'Orders Sheet'!$A$5:$BZ$49,27,FALSE)
D14=E14+C14
D15=C15-E15
E14=VLOOKUP(Report!$B$1,Shortages!$A$5:$BZ$49,28,FALSE)
E15=VLOOKUP(Report!$B$1,Shortages!$A$5:$BZ$49,27,FALSE)
I14=H14-J14
I15=H15-J15
 
Last edited:

Excel Facts

Select all contiguous cells
Pressing Ctrl+* (asterisk) will select the "current region" - all contiguous cells in all directions.
nevermind, i figured it out as soon as i hit the submit button

=IF((VLOOKUP(Report!$B$1,Shortages!$A$5:$BZ$49,28,FALSE))<0,0,VLOOKUP(Report!$B$1,Shortages!$A$5:$BZ$49,28,FALSE))
 
Upvote 0

Forum statistics

Threads
1,224,506
Messages
6,179,158
Members
452,892
Latest member
yadavagiri

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