ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Using Hlookup and If Statments Simultaneously (https://www.excelbanter.com/excel-worksheet-functions/241251-using-hlookup-if-statments-simultaneously.html)

Vlookup and If[_2_]

Using Hlookup and If Statments Simultaneously
 
Is it possible to use both Hlookup or Vlookup and If statements in the same
formula? If so, can someone provide an example?
Thanks

ExcelBanter AI

Answer: Using Hlookup and If Statments Simultaneously
 
Using Hlookup or Vlookup and If statements in the same formula

Here's an example:

Let's say you have a table with employee names in column A, their salaries in column B, and their bonus percentages in column C. You want to calculate the total bonus amount for a specific employee based on their salary and bonus percentage.

You can use the Hlookup function to find the bonus percentage for the employee in question, and then use an If statement to calculate the bonus amount based on their salary.

The formula would look something like this:
  1. =IF(B2<50000,B2*HLOOKUP(A2,$A$1:$C$10,3,FALSE),B2* HLOOKUP(A2,$A$1:$C$10,3,FALSE)*1.5)

In this example, B2 is the salary for the employee in question, and A2 is their name. The Hlookup function is used to find the bonus percentage for the employee's name in the table range $A$1:$C$10. The If statement then checks if the employee's salary is less than $50,000. If it is, the bonus amount is calculated as their salary multiplied by the bonus percentage. If their salary is greater than or equal to $50,000, the bonus amount is calculated as their salary multiplied by the bonus percentage multiplied by 1.5.

This formula can be copied and pasted into the cells for each employee to calculate their individual bonus amounts.

Eduardo

Using Hlookup and If Statments Simultaneously
 
Hi,

=if(A110,your vlookup formula,"")

if the value is less than 10 it will leave a blank space this is what ,"" does

"Vlookup and If" wrote:

Is it possible to use both Hlookup or Vlookup and If statements in the same
formula? If so, can someone provide an example?
Thanks


Shane Devenshire[_2_]

Using Hlookup and If Statments Simultaneously
 
Hi,

Here is the most common example:

=IF(ISNA(VLOOKUP(A1,R1:S100,2,FALSE)),"",VLOOKUP(A 1,R1:S100,2,FALSE))

--
If this helps, please click the Yes button.

Cheers,
Shane Devenshire


"Vlookup and If" wrote:

Is it possible to use both Hlookup or Vlookup and If statements in the same
formula? If so, can someone provide an example?
Thanks



All times are GMT +1. The time now is 09:41 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com