Excel vlookup and if - excel

Ok so I am fairly new to using excels formula functions and I am still learning. What I am trying to do is combine two statements both work independently but I need them together. the two statements are an if statement and a vlookup and are as follows
=IF(C5>=$J$4,"YES","NO")
=VLOOKUP(C6-500,$H$5:$I$8,2)
The vlookup needs to take the spot of the yes part in the if so I don't get the error message that get because some values are below the threshold for the vlookup but I want to simply say that they are not valid hence the if statement.
If there are any better ways to do this I am all ears.

If you want to put VLookup() in the yes part then put the formula as below.
=IF(C5>=$J$4,VLOOKUP(C6-500,$H$5:$I$8,2),"NO")
If you want to control errors by formula then use IFERROR() function. Like
=IFERROR(IF(C5>=$J$4,VLOOKUP(C6-500,$H$5:$I$8,2),"NO"),"")
IFERROR() with VLookup() only.
=IFERROR(VLOOKUP(C6-500,$H$5:$I$8,2),"")

Related

How can I see which cells are being used in AVERAGEIFs function in Excel? Use VBA to take in those True values

I have a bunch of AVERAGEIFS functions used throughout my worksheet and now I want to make a list of all the values that are being averaged using the functions. Only the values that satisfy the formula. I have VBA code that asks the user to choose a cell with the formula in it and I want the code to list out the values that are being averaged. Thank you!
I've tried thinking about this in a few different ways but I'm hoping there's an easier way than maybe using xlookup and then averaging everything so that it's easier to create his list of values.

Excel INDIRECT function gives #N/A, WHY?

I have the following excel formula:
=CORREL(INDIRECT("Raw0!"&COL_LETTER(Raw0!B$795)&MATCH("z";Raw!$B1:$B795;0)&":"&COL_LETTER(Raw0!B$795)&CELL("row";Raw0!B795));INDIRECT(COL_LETTER($B797)&MATCH("z";Raw!$B5:$B795;0)+ROW(B7)-1&":"&CELL("address";$B797)))
It looks complicated but the idea is rather simple, I want to define 2 arrays with INDIRECT functions in order to calculate cross-correlation between the arrays, i.e.:
=CORREL(array1;array2).
The above formula always gives me #N/A, i.e. excel error message "not available".
However, if I put the arguments of the two INDIRECT functions above in a couple of cells, let's say C803 and C804, and the I use the formula
=CORREL(INDIRECT(C803);INDIRECT(C804))
it works fine.
How is it possible? as cells C803 and C804 contains exactly the same writings I used in the first function above, i.e.:
C803 contains
="Raw0!"&COL_LETTER(Raw0!B$795)&MATCH("z";Raw!$B1:$B795;0)&":"&COL_LETTER(Raw0!B$795)&CELL("row";Raw0!B795)
and C804 contains
=COL_LETTER($B797)&MATCH("z";Raw!$B5:$B795;0)+ROW(B7)-1&":"&CELL("address";$B797)
Note: COL_LETTER() is a simple VBA function I created that returns the letter of the column of the cell argument. It works fine, I tested it.
Thanks for the attention.

Using IF formula twice with vlookup

I want to use IF formula twice with Vlookup in order to extract specific data from another sheet with 2 logic commands and using this formula:
=IF($Q$4=DATA!A3,master!A11=DATA!$C$2,VLOOKUP(master!O13,DATA!B3:G52,6))
Kindly suggest me how to apply this formula correctly.Thanks
It seems to me that you need AND():
=IF(AND($Q$4=DATA!A3,master!A11=DATA!$C$2),VLOOKUP(master!O13,DATA!B3:G52,6),"This
message will appear if conditions are not met")

Excel SUMIFS Formula

I am using the Excel SUMIFS formulas to look for certain item numbers and add that value to the sum. The issue I am having is that many of our item numbers are very close to each other, i.e. 52000135890001 & 52000135890002.
The issue I am having is that the SUMIFS function seems to see these two items as the same value, and is suming them together. I want them added separately, as to us, they are essentially two different items.
I have tried changing the data type for the item numbers to every possible option but the formulas continues to group these together when performing the function.
Does anyone have any ideas how I can still use the SUMIFS formula but somehow tell it to see these two items as different, instead of adding them together under the same criteria?
I am at a loss and losing my mind so any advice would be beyond helpful!
Kyle
You format all your required cells (range cells, criteria and sum_range cells) to custom format as ##################', then apply the sumif it will work by using the right value.

Product With SUMIF Function When Using ROUND Function

I'm trying to find a way to get the same results as the following function, but without using SUMPRODUCT, since SUMPRODUCT is not supported in Documents To Go for iPhone.
=SUMPRODUCT(($D$2:$D$50000="O")*ROUND($C$2:$C$50000,0))
I have tried using SUMIF and SUMIFS, but both result in errors. Neither likes the use of the ROUND function.
=SUMIF($D$2:$D$50000,"O",ROUND($B$2:$B$50000,0))
=SUMIFS(ROUND($B$2:$B$50000),$D$2:$D$50000,"O")
Thanks in advance!
I have tried using SUMIF and SUMIFS, but both result in errors. Neither likes the use of the ROUND function
That is because SUMPRODUCT can take in array values while SUMIF cannot.
I'm trying to find a way to get the same results as the following function, but without using SUMPRODUCT, since SUMPRODUCT is not supported in Documents To Go for iPhone.
I do not see a way to implement that exact functionality without having the formula or changing the spreadsheet slightly.
You can get close by using =ROUND(SUMIF($D$2:$D$50000,"O",$C$2:$C$50000),0) which will round the end value instead of each individual value.
However you could change the spreadsheet by making another column (lets say E) that is just the rounded version of column C and use =SUMIF($D$2:$D$50000,"O",$E$2:$E$50000)
Or you could make a custom function that implements the same functionality as SUMPRODUCT and use that.
In Excel you can use an "array formula" like this
=SUM(IF($D$2:$D$50000="O",ROUND($C$2:$C$50000,0)))
Not sure if Documents To Go will support array formulas? In Excel that formula needs to be confirmed with CTRL+SHIFT+ENTER

Resources