=IF Help

tandkb

Board Regular
Joined
Dec 29, 2010
Messages
51
Office Version
  1. 365
Platform
  1. Windows
Hi,

Can someone tell me why my If statement is not working.

=IF(A5=B4,1,SUMPRODUCT(($A5&$A$4=Transfers!$G$5:$G$5000&Transfers!$C$5:$C$5000)*(B$4=Transfers!$F$5:$F$5000)*(Transfers!$J$5:$J$5000)))/SUMPRODUCT(($B$4&$A$4=Transfers!$F$5:$F$5000&Transfers!$C$5:$C$5000)*(B$4=Transfers!$F$5:$F$5000)*(Transfers!$J$5:$J$5000))

In this case A5 does equal B4 but it is not putting 1 in the cell. A5 and B4 are both words and they are exactly the same so it should be putting a 1 in the cell but it is just running the forumla after the , Any help would be greatly appreciated.

Thanks!
 

Excel Facts

Spell Check in Excel
Press F7 to start spell check in Excel. Be careful, by default, Excel does not check Capitalized Werds (whoops)
One possibility is that A5 and B4 look like they are the same but one or both have some extra spaces. In any empty cell enter: =EXACT(A5,B4)
If that returns False try: =EXACT(TRIM(A5),TRIM(B4))

if that returns True one or both cells have some extra spaces. In that case you can use the TRIM functions in your formula or you can remove the spaces.
 
Upvote 0
Rewrite the same data in both columns.
Check that they do not have spaces before or after the word.
Confirm with this formula:

=exact(A5,B4)
 
Upvote 0
I used the exact forumla and returns true. Hmmm.
 
Upvote 0
What ARE the values in A5 and B4 ??
 
Upvote 0
This part of the formula is outside the If, ​​if the first one is met, return 1 but then it is divided by the result of the formula.

/SUMPRODUCT(($B$4&$A$4=Transfers!$F$5:$F$5000&Transfers!$C$5:$C$5000)*(B$4=Transfers!$F$5:$F$5000)*(Transfers!$J$5:$J$5000))
 
Upvote 0
Ah, Is there a way to make is where that is not outside of the the If,?

Thanks so much!
 
Upvote 0
Try this

=IF(A5=B4,1,(SUMPRODUCTO(($A5&$A$4=Transfers!$G$5:$G$5000&Transfers!$C$5:$C$5000)*(B$4=Transfers!$F$5:$F$5000)*(Transfers!$J$5:$J$5000)))/SUMPRODUCT(($B$4&$A$4=Transfers!$F$5:$F$5000&Transfers!$C$5:$C$5000)*(B$4=Transfers!$F$5:$F$5000)*(Transfers!$J$5:$J$5000)))
 
Upvote 0
Im glad to help you. Thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,214,641
Messages
6,120,694
Members
448,979
Latest member
DET4492

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