Combining V Look Up and IF formula

gladiator4

New Member
Joined
Jan 19, 2017
Messages
2
Hi there,

Finding it tricky combining vlookup and if function. I have set out a basic 2 tables below. I am trying to input my result into Column C rows 1 -3. I want to produce "Large", "Medium" or "Small" based on Table 2 below using the vlookup and If function. Can any one help with the formula?

Thanks

<style><!--table {mso-displayed-decimal-separator:"\."; mso-displayed-thousand-separator:"\,";}@page {margin:.75in .7in .75in .7in; mso-header-margin:.3in; mso-footer-margin:.3in;}td {padding-top:1px; padding-right:1px; padding-left:1px; mso-ignore:padding; color:black; font-size:12.0pt; font-weight:400; font-style:normal; text-decoration:none; font-family:Calibri, sans-serif; mso-font-charset:0; mso-number-format:General; text-align:general; vertical-align:bottom; border:none; mso-background-source:auto; mso-pattern:auto; mso-protection:locked visible; white-space:nowrap; mso-rotate:0;}.xl63 {border-top:none; border-right:none; border-bottom:.5pt solid windowtext; border-left:none;}--></style>
ABC
Table 1
Unit typeSizeResult
1Co Work1000
2Studio1500
3Event5000
4
5Table 2
6Unit TypeSizeLimit
7Co WorkSmall<500
8Co WorkMedium500-1500
9Co WorkLarge>1500
10StudioSmall<500
11StudioMedium500-1500
12StudioLarge>1500
13EventSmall<2000
14EventMedium2000-4000
15EventLarge>4000

<!--StartFragment--> <colgroup><col width="87" span="4" style="width:65pt"> </colgroup><tbody>
<!--EndFragment--></tbody>
 

Excel Facts

What does custom number format of ;;; mean?
Three semi-colons will hide the value in the cell. Although most people use white font instead.
Hi there,

Finding it tricky combining vlookup and if function. I have set out a basic 2 tables below. I am trying to input my result into Column C rows 1 -3. I want to produce "Large", "Medium" or "Small" based on Table 2 below using the vlookup and If function. Can any one help with the formula?

Thanks

<style><!--table {mso-displayed-decimal-separator:"\."; mso-displayed-thousand-separator:"\,";}@page {margin:.75in .7in .75in .7in; mso-header-margin:.3in; mso-footer-margin:.3in;}td {padding-top:1px; padding-right:1px; padding-left:1px; mso-ignore:padding; color:black; font-size:12.0pt; font-weight:400; font-style:normal; text-decoration:none; font-family:Calibri, sans-serif; mso-font-charset:0; mso-number-format:General; text-align:general; vertical-align:bottom; border:none; mso-background-source:auto; mso-pattern:auto; mso-protection:locked visible; white-space:nowrap; mso-rotate:0;}.xl63 {border-top:none; border-right:none; border-bottom:.5pt solid windowtext; border-left:none;}--></style>
ABC
Table 1
Unit typeSizeResult
1Co Work1000
2Studio1500
3Event5000
4
5Table 2
6Unit TypeSizeLimit
7Co WorkSmall<500
8Co WorkMedium500-1500
9Co WorkLarge>1500
10StudioSmall<500
11StudioMedium500-1500
12StudioLarge>1500
13EventSmall<2000
14EventMedium2000-4000
15EventLarge>4000

<tbody>
</tbody>

Table 1
Unit typeSize
Co Work1000499149999999medium
Studio1500499149999999large
Event50001999399999999large
Co Work400499149999999small
Studio300499149999999small
Co Work1700499149999999large
Studio1300499149999999medium
Event35001999399999999medium
Co Work1400499149999999mediumsmallmediumlarge
Studio2100499149999999largeCo Work499149999999
Studio499149999999
Event1999399999999
I used offset match to put the correct parameters
against every job and an if statement to assign small, medium or large

<colgroup><col span="2"><col><col><col span="9"></colgroup><tbody>
</tbody>
 
Upvote 0
A
B
C
1
2
Co Work
1,000
medium
3
Studio
1,500
Large
4
Event
5,000
Large

<tbody>
</tbody>

In your second table you should but the points where it changes with out any < or >
Table did not like 0 in cell the small rows should have 0 in column H
F
G
H
1
2
Co Work
small
3
Co Work
medium
500
4
Co Work
Large
1,500
5
Studio
small
6
Studio
medium
500
7
Studio
large
1,500
8
Event
small
9
Event
medium
2,000
10
Event
large
4,000

<tbody>
</tbody>



In C2 Try this array formula must be entered with Control-Shift-Enter then copy down. Change cell references as need
Code:
{=INDEX($G$2:$G$10,MATCH(B2,IF(A2=$F$2:$F$10,$H$2:$H$10),1))}
 
Last edited:
Upvote 0
Welcome to the forum!

If you can change the "limits" in table1 as in the example below, then you could give this a try:


Excel 2013
ABCDEFG
1Unit TypeSizeLower LimitUnit typeSizeResult
2Co WorkSmall0Co Work500Medium
3Co WorkMedium500Studio1500Medium
4Co WorkLarge1501Event5000Large
5StudioSmall0
6StudioMedium500
7StudioLarge1501
8EventSmall0
9EventMedium2000
10EventLarge4001
Sheet1
Cell Formulas
RangeFormula
G2=LOOKUP(F2,$C$2:$C$10/($A$2:$A$10=E2),$B$2:$B$10)
 
Upvote 0
Hi all,

Thanks so much for all the help. Considered all the options but ended up going for the simpler Look Up function. Realised this means I have to have my lookup table sorted in ascending order for the formula to work.

Seems to have done the job so thank you for the ideas!

G

If you can change the "limits" in table1 as in the example below, then you could give this a try:

Excel 2013
ABCDEFG
1Unit TypeSizeLower LimitUnit typeSizeResult
2Co WorkSmall0Co Work500Medium
3Co WorkMedium500Studio1500Medium
4Co WorkLarge1501Event5000Large
5StudioSmall0
6StudioMedium500
7StudioLarge1501
8EventSmall0
9EventMedium2000
10EventLarge4001

<colgroup><col style="width: 25pxpx"><col><col><col><col><col><col><col></colgroup><thead>
</thead><tbody>
</tbody>
Sheet1

Worksheet Formulas
CellFormula
G2=LOOKUP(F2,$C$2:$C$10/($A$2:$A$10=E2),$B$2:$B$10)

<thead>
</thead><tbody>
</tbody>

<tbody>
</tbody>

[/QUOTE]
 
Upvote 0

Forum statistics

Threads
1,215,754
Messages
6,126,680
Members
449,328
Latest member
easperhe29

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