excel


Does excel have an if statement equivelent? I can't get this program to work


The program has 5 columns.
Column A has item names
Column B has item sizes
Column C has item quantities
Column D has items that i need
Column E has the sizes for those items in the rows corresponding to the items
Most items do not have multiple sizes, but for the ones that do, there will be multiple entries of that item in column A.
What I need to do is take all the items from column D and find them in column A and give me the corresponding quantity from C.
I have been using this code to achieve this. =INDEX(C:C,MATCH(D:D,A:A,0))
This works for all items besides the ones with multiple sizes. For these items it just spits back the first size number every time.
Would there be a way to match A and D, and then check if there is a value in the size column, if so, give out the correct number?
I see how my wording is confusing here is an example of what I mean.
apples 5lb bag 12 apples 10lb bag
apples 10lb bag 13
bananas 5 grapes
grapes 7
Which using the is line of code "=INDEX(C:C,MATCH(D:D,A:A,0)) " would result in giving me the correct "7" for the grapes, but for the apples, it would give me the first result it comes across, which is the 12.
How would I get it to check the other columns to give me the 13 for apples?
If I understand correctly then this will get you the correct number:
=IF(E2<>"",SUMIFS(C:C,A:A,D2,B:B,E2),SUMIFS(C:C,A:A,D2))

Related Links

In a multi-sheet workbook, how do I code a multi-column sort in VBA?
How to merge multiple workbooks into one based on workbooks names
Changing range in a lookup formula based upon a value
VBA error on “Loop Until” statement
Possible to use QUARTILE function over a conditional range in Excel? [closed]
How to transpose the value in excel based on condition?
“Cannot insert object” Error when inserting PDF files/objects into Microsoft Excel
Referencing the selection in deactivated Workbook
Excel - Export cells identified by countif to new file
Attempting to search for strings and having syntax errors
Excel Error 1004 when referencing ranges with VBA
Multiple uses of SaveAs freeze Excel
XYScatter Plot Incorrect XAxis when Drawn in Visual Basic?
Why is “if isna vlookup” quicker than “countif”?
PrintLoop mass print all rows of data in file
Look for which cell in a row has a numberic value and return that value to another cell

Categories

HOME
loops
sails.js
local-storage
netlogo
migration
google-speech-api
sharppcap
amazon-redshift
javafx-2
bootstrap-datepicker
filesystems
visual-foxpro
geogebra
rpres
fluent-assertions
dynamics-ax-2012
postgresql-9.0
sprite
libcurl
integer
xlwings
xfce
silex
dsolve
autoload
uppaal
inorder
webm
android-adapter
x509
uppercase
android-debug
spamassassin
azure-virtual-machine
envelope
digestive-functors
bspline
actor
spring-cloud-sleuth
scalacheck
cartography
roc
google-truth
xunit.net
audiounit
angular-chart
wamp-protocol
equation-solving
graylog
android-gson
kubernetes-health-check
cpio
ldflags
report-viewer2012
raptor
devpartner
ratchet
iis-8.5
shapely
8085
hottowel
jedit
fedora-commons
7digital
wordpress-4.5
fswatch
mpmediapickercontroller
pysftp
html5-template
dotdotdot
ekeventstore
android-bundle
savefiledialog
event-loop
ontouchevent
magnetometer
vin
comfortable-mexican-sofa
django-1.7
data-sharing
sine-wave
triples
galera
intel-galileo
linq-to-lucene
usermode
offlineapps
stubs
citrix-access-gateway
mindmap
meteor-slides
jbossws
dynamic-languages
sequence-alignment
memory-mapped-files
viewstack
osx-gatekeeper
mahjong
www-mechanize
cck
uint32

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App